As the primary scenario for Git, introduce this excellent version control tool in the simplest way, typically:
There is a local project, such as the name "Hellopro", because we need to share the code, co-development, so we need to use GitHub or other servers to host the Git library.
Here are just the simplest things to do in Windows, so the tips for some operations may not be visible, and advanced use bash.
1.init
The easiest way to get to the project folder: Right-click Git Init here
After the operation is complete, the right-click menu appears Git Add all files now and so on
2. Add
This step involves adding a new project to the index library, which is the simplest way to run the command before each commit: Right-click Git Add All Files now
After the operation is complete, there is no change, but it has succeeded, and if you can see the details from the command line.
3. Commit
This step is to submit a new file or a change file to the warehouse (not a remote repository), you need to run the command before each commit, the simplest way: right-click Git Bash
Run
git commit- M"submitted descriptive information"This step uses the command line, which is simpler than using the GUI.
4. Setting up a remote repository
GitHub, for example, open GitHub, click New to create a new warehouse, and we recommend creating a. gitignore file at the same time. Not detailed.
5. Connect to the remote repository
The goal of this step is to connect the local git library to the remote Git repository for updates and uploads, which is just as simple as git init when the library is built, the simplest way: right-click Git Bash
Run
git remote add origin https://github.com/your user name/project name
6. Update from the remote repository
This step will be used frequently in the future development process, like the SVN update, the simplest way: right-click Git Bash Run
git pull Origin master
7. Upload the project file
This step will be used frequently in the future development process, like SVN commit, the simplest way: right-click Git Bash Run
git push Origin master
You will be prompted to enter your account password
At this point, log in to the remote repository to check if the file was uploaded successfully.