1. Git remote–v
View Remote repositories
2. Git remote add weixin-old-remote https://git.sprucetec.com/meicai/weixin-old.git
Add a remote repository
3. Git fetch upstream
The pull does not change in the local repository and does not modify your own files.
4. Git branch–r
View all branches on a server
5. Git branch–a
View all branches on the local and server
6. Git branch Mybranch
Create a branch named Mybranch
7. Git branch-d mybranch
Delete Mybranch Branch
8. Git checkout Mybranch
Make Mybranch A current active branch
9. Git checkout-b mybranch
Creates a Mybranch branch and acts as the current active branch
Ten. Git checkout--protected/views/
Pull the contents of the server-side protected/views/folder
git merge Mybranch
Merge the Commit of the mybranch to the master branch
Git rebase weixin-old-remote/v.150906_shanghu
Get the latest code on the branch V.150906_shanghu, merge it, and put your far end at the top
Git stash
Save current changes
. Git Stash List
View the stash list, which is to view the staging list
The. Git stash pop
Take out the latest staging data
. Git status
View status, list all files in the current directory that have not yet been managed by git, and files that have been managed and modified by git but have not yet been submitted
. Git log
Viewing log information
Git push Origin V.150906_orderread
Push to remote
git diff <source_branch> <target_branch>
. Git diff peotected/views/
Gets the changes to the contents of the peotected/views/file in the current active branch
. Git reset head.
Fallback to previous version
A. Git Add.
Submit File
. Git commit-m ""
Submit a Comment
Common git commands