First, the principle
- The initial project to build a framework
- Knock Code (perform one function)
- After completion of a function using a tag Tag Git
- Back to the Original framework
- Knock Code (complete another function, and so on)
Second, use the steps
(A) preparation phase
- The initial project to build a framework
- Creating a warehouse: $ git init
- Add files to the repository: $ git add.
- The initial project framework will be submitted to the warehouse: $ git commit -m "comment information"
- Establish a remote git repository
- Local warehouse and associated remote repository: $ git remote add origin HTTPS source file
- The local repository pushed to the remote repository: $ git push -u origin master
(B) the learning phase
- 1 thematic learning code Qiaowan it will be submitted to the local repository.
- Add tag to git: $ git tag tag title.
- View all current repository git: $ git tag
(C) fallback code learning another topic
- Roll back code to the initial version of the project: $ git reset --hard version number
- Code rollback to any git: $ git checkout tag title
III clone codes
$ Git clone source address