Link: http://blog.csdn.net/zhangyaoming2004/article/details/9202269
Common git commands
Git clone address: copy the code library to a Local Machine
Git add file: add the file to the code library.
Git RM file: delete files in the code library
Git commit-M <message>: Submit the changes. After modifying the file, use this command to submit the changes.
Git pull: Synchronize code from remote to local
Git push: Push code to remote code library
Git branch: view the current local branch
Git branch-r view remote Branch
Git branch <branch-Name>: Creates a local branch.
Git branch-D <branch-Name>: deletes a local branch.
Git checkout <branch-Name>: switch to the local branch
Git push origin test: MASTER: Submit the local test branch as the remote master Branch (what if you want to delete the remote branch? Similarly, if the left branch is empty, the remote branch on the right will be deleted .)
Git log: view the commit record (History of the commit record)
Git status: the current modification status. Whether the modification has not been submitted, or which files are not used
Git reset <log>: returns to a previous version.
Git tag <Name>: Create version
Git Tag: View version
Git tag-D <Name>: delete version
Git tag-R: view the remote version
Development Process:
The GIT process is generally used:
1. edit the file and update the code.
2. Fill in the Code to the list of changes currently submitted: git add <modified File>
3. Submit the current modification as a record: git commit-M <message>
4. Update the code: git push
FAQs:
1. When to submit a change record (COMMIT)
Add a new feature or break the original structure, and even each change can be used as a basis for submitting change records
2. When to push updates)
In general, if you change the project structure (file, directory), you should push the update as soon as possible to notify other collaborators to follow up on the update.
3. When is remote synchronization (pull)
Synchronization should be performed every time you start to work.
4. When to open a branch)
Remote branch, by function
Local branch, random
[Switch] git usage rules