git commonly used commands and tools

Create and switch to a new branch

$ Git branch chunhong / recordTest // create a branch
$ git checkout chunhong / recordTest // switch to the new branch
$ git branch // display branch roughly
$ git show-branch // show detailed branch
will own branch push to a remote repository

$ Git status // viewing the file changes state
$ git diff // compare file changes the Samples / algo_app / src / main / JNI / app_auto_recharge / AutoRechargeStateMachine.cpp
$ git the Add. // add all changes to the temporary
$ git commit -m "add datarecord loop file" // submit the temporary
$ git push // push to a remote repository
when using git push, sometimes prompted fatal the current branch xxx has no upstream branch ... problems, problems mentioned above, indicating that the remote did not perceive this new local branch, executable

Branch --set-upstream git $
$ -u git Origin Chunhong the Push / // Chunhong the Test / local is the Test new branch
will own branch and merge dev

$ git checkout chunhong / recordTest // switch to its own branch
$ git merge dev // dev merged with the
acquiring others added new branches

git fetch origin // update
git checkout branch //
git pull // merge the changes to the remote repository current branch
to configure the user name and password

$ Git config -l // lists all the configuration list
$ git config --global user.name "lichunhong" // Set global user name git
$ git config --unset --global user.email // remove settings
Additional references URL:

Conflict resolution: https: //mp.csdn.net/mdeditor/82011703#

Released five original articles · won praise 4 · Views 8576

Guess you like

Origin blog.csdn.net/zx_yangyi/article/details/100575712