Git usage in linux
1. Common Operation 1: clone a remote warehouse, for example, clone test project branch v1.0
Git-c diff. mnemonicprefix = false-c core. quotepath = false clone -- branch v1.0 https://git.oschina.net/test.git/Users/test
After this part is executed, you will be prompted to enter account and password 2 of the repository and add local modifications.
Git add file names (multiple file names are separated by spaces)
3. Push all changes
Git commit-a-m' this is the comment'
-A indicates all,-m code message comment 4, pull remote update
Git pull
Here you will be prompted to enter account password 2, common error 1, the following error occurs when git pull: error: Your local changes to the following files wocould be overwritten by merge: this is a version conflict between the local and remote repositories. In this case, we first hide the local modifications, pull the remote updates, restore the local modifications, and then submit:
Git stashgit pullgit stash popgit commit-a-m' comment'
2. the following error occurs when git pull is not possible because you have unmerged files. in fact, it is a continuation of Error 1. If you forget to execute git commit-a-m, you can directly execute git pull again:
Git commit-a-m' comment'
If you want to use a file in the code library to completely overwrite the local working version, the method is as follows:
Git reset -- hardgit pull
The above methods must be executed in the git project directory.