git
version control
git init initialization warehouse
git init file creation and initialization warehouse
git status View status
git add filename / add content changes to the staging area
git -m 'descriptions' commit to the repository
View version git log record
git reflog view the version change history
git reset --hard version number and version rollback
Branch
The default master
View all branches git branch
New branch git branch branch
branch branch switching git checkout
git merge new branch of the new branch into the current branch
Conflict need to manually resolve conflicts that might arise in merger
git stash hidden in the current operation somewhere in the
Personal Development
master dev debug
Development function on the dev branch
Merged into the master branch (branch master can be placed on the word line)
master branch code has bug
- Create a debug branch
- Switching to debug branch changes bug, the version submitted
- Switch back to the master branch, merge debug branch
dev development, development to half:
1. git stash 隐藏当前的操作
- Repair finish line bug, debug branch merge, delete debug branch
- git stash pop back before the operation, continue to develop
码云 GitHub gitlab
Individual Corporate home
The company commuting:
git add .
git commit - m 'Not Done'
git push origin dev
Then home development:
Download and install git configuration
git clone https://gitee.com/maple-shaw/day68.git
git branch dev
git checkout dev
git pull origin dev
Then development function
Developed
git add .
git commit - m 'function'
git push origin dev
Work the next day:
git pull origin dev
There are conflict resolution conflict
Continue to develop
Collaborative Development
master dev everyone to create their own branch
Everyone in their own branch development capabilities
After development is complete add commit pushed to the remote repository own branch
Merge pull request submitted to the dev branch