Git remote

git remote -v
Copy the code

Delete remote project address:

git remote rm origin
Copy the code

Add remote code repository:

Git remote add origin http://10.5.1.22:7990/scm/address/spatial-semantic-v2-be-engine.gitCopy the code

Change the git remote repository address to the new git remote repository address:

Git remote set - origin url http://10.5.1.22:7990/scm/address/spatial-semantic-v2-be-engine.gitCopy the code

Clone code:

Git clone http://10.5.1.22:7990/scm/address/spatial-semantic-v2-be-engine.gitCopy the code

Pull code:

Git pull Origin Branch nameCopy the code

Update code:

Git add. Git commit -mCopy the code

New local branch:

Git branch Specifies the branch nameCopy the code

Delete a local branch:

Git branch -d Specifies the branch nameCopy the code

Delete remote branches:

Git push origin -d branch nameCopy the code

View local branches:

git branch
Copy the code

View remote branches:

git branch -a
Copy the code

Switch branches:

Git Checkout branch nameCopy the code

Pull other branches in the remote repository

Git checkout -b 1215xcswGIS origin/1215xcswGIS # git checkout -b 1215xcswGIS originCopy the code

Git pull vs. Git Fetch

Git pull is context-sensitive, it automatically merges all commits to you and merges them into the current branch. There is no review process. Git Fetch just stores pulled commits to the local repositoryCopy the code