Git simple instructions
Branch Management
Creating a branch
gitlab create branches based on the following main remote repository
1. dropdown Code
git clone ....
2. Go to the folder, create a local branch
git branch (分支名) origin/master
Here is the master branch-based remote repository created, it can create based on other branches.
3. The local branch into a remote
git push origin (分支名)
This step is the local branch in order to push the remote, push the remote branch, you can create a local branch based on this branch, which is handy for testing on another computer
Branch operation
This introduces two points:
1. The handover branch
git checkout (分支名)
2. Display the current branch
git branch
Code Submit
Making code changes that we need to submit revised content, the main steps are:
1. Modify View
git status
In this step we modify the content can be displayed, determine what changes are to be saved, which is not to amend the
2. Save Changes
git add
3. Save to a local warehouse
git commit -m "修改内容说明"
4. submitted to the server
git push origin (分支名)
After this step, we submit the code finished, if elsewhere the remote branch, you can pull down the latest code
log, can be used to modify
git log
To view it
Code Merger
After the code will be revised and, if need be merged with other branches of the code, the main operations are:
1. Update the latest changes pulldown down
git fetch
2. Check whether there is a conflict, if there is going to resolve the conflict
git rebase origin/master
3. Push-code combined
git push -f origin (分支名)
-f是强制推送