git common commands use

git branch -a to view all branches

As shown, it is currently on the local dev branch

git checkout master switches to the local master  branch

git pull to get the latest code on master

git branch -d dev deletes the local branch dev, in order to delete it first when creating a new dev branch, the names cannot be the same

git checkout -b dev Create a new local branch dev, at this time the dev branch has the same code as the remote master branch

Modify the code on the dev branch. . . .

git commit submit local modified code

A file has been modified

git checkout . # All local modifications. If there are no commits, return to the original state, if you want to restore the code, otherwise skip it

git commit -a commits all changes in the current dev

or

git commit -a src/main/java/com/honour/site/modules/sale/web/SaleLoanController.java Commit changes to some of the current dev files

git status to see which files are not committed

git commit -am "init" commit and comment

git checkout master switch branch to master to pull the latest code

git pull to get the latest code

git merge dev merges with dev on the local master branch


git log View the merged branch submission status, enter q to exit the log

 

git push commit master


Submit completed



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324645191&siteId=291194637
Recommended