Learning Materials: progit. orgbookzh common operation to retrieve code: gitclonegit @... method 1: add the file gitadd file name 2. Submit the file to the local data warehouse gitcommit-m for modification reasons 3. Synchronize the file to the master data warehouse gitpush to delete the file gitrm file name Delete the directory gitrm-r file name
Learning Materials: http://progit.org/book/zh/ common operations to get code: git clone git @... file submission method 1. add file git add file name 2. Submit the file to the local data warehouse git commit-m' modify reason 3. Synchronize the file to the master data warehouse git push delete file git rm file name Delete directory git rm-r file name
Learning Materials: http://progit.org/book/zh/
Common Operations
Retrieve the Code:
Git clone git @...
File submission method
1. Add a file
Git add file name
2. Submit to the local data warehouse
Git commit-m' reason for modification'
3. synchronize data to the Master Data Warehouse
Git push
Delete an object
Git rm file name
Delete directory
Git rm-r file name
View logs
Git log
Git log-p view the log and display the difference
Git log-2 shows the last two logs
Compare files
Git diff file name
Cancel added files
Git reset HEAD file
Cancel the previous commit
Git reset HEAD ^
Branch Management and Use
Create Branch
Git branch name
View Branch
Git branch
Git branch-a view all branches (including remote)
Create and switch to Branch
Git checkout-B branch name
Switch to a branch
Git branch name
Delete Branch
Git branch-d branch name