Use of git at work

git distributed version control

Use the current directory as the Git repository, initialize git init (this command will generate a .git directory)
1.1 Switch to the master branch
Git checkout master
1.2 Pull the code of the master remote branch
git pull origin master
1.3 Create a new branch and switch to the new one
git checkout -b first 1.4 on the new branch
, push the code to the remote branch
Git status
Git add .
git commit -m "the first commit meg"
========== Next day Work starts ==========
Git checkout master
git pull origin master
git checkout first
merge the latest code from master into the current branch
Git rebase -i master

When all coding work is done, push the code to the remote Branch
Git push --set-upstream origin master
When all the code has been pushed to the remote branch, the code can not be merged to the master, what should be done is to pull requset
1.5 Merge the code to the master, and delete the previously created branch
git checkout master
git merge first
git push origin master
git branch -d first

Guess you like

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