Daily Development Series
git status
: Check local changesgit pull --rebase
: Pulling the distal end of the code and combinedgit add .
: Scratch all local codes updatedgit add -p
: On-demand staging local update the code, if need be submitted to follow the prompts fory
not submitting inputn
, automatically enter the nextgit push
: Submit native codegit checkout -b +分支名
: New git branch, and switch to the new branchgit checkout +分支名
: Switching to the branchgit stash save
: Will not scratch code isolationgit stash pop
: Restore the isolation of code to localgit log
: View Submission Historygit diff +分支名
: Comparison with other branches of the current branch codegit cherry-pick + 需要合并到当前分支的其他分支的commitId
git commit --amend
: Information on the changes once commit or commit the information to be used once this commitgit branch -v
: View the current branchgit reset --hard + 回退到不需要的代码的上一次commitId
: After back to back, after commitId (chronologically) code is missing, the local is not retained.
git remote series
: Reference github- manage remote warehouse
submission address 1. Add the local project code
git remote add <remote name, usually origin> <LOCATION>
Examples: git remote add origin [email protected]/lb01-bsdd-vm.git
2. Delete the remote address
git remote rm <distal name>
Examples: Origin RM Remote Git
2. Submit the remote address setting
git remote set-url --push origin <LOCATION>
3. Review the settings distal submitted
git remote -v
4. merge, change a few commit records recently submitted
2 ~ -i the HEAD rebase the Git (commit number is included in, a variable quantity)
Git commit --amend (Change last commit record)
Operation: git commit --amend, press i
the enter edit mode, editing is complete, shift+:
enter wq
to save and exit.
git config configuration Series:
Check local git configuration:
git config --list
Set code repository user name
git config --global user.name Username
Set code repository user's mailbox
git config --global user.email user's mailbox
View the source Download
View Download Source:
yarn config get register
Set the download source:
yarn config set register source address
Initialize the project and submit
- git init
- git add when change
- git commit -m 'project initialization'
- Add distal project addresses submitted git remote add origin [ssh Address]
- git remote -v: view the added address is successful, and push the fetch address contains the instructions to add success
- git push --set-upstream origin master
- If the previous step reported the following error:
enter ssh-keygen -t rsa -C [git a global user name], the user name can be viewed by git config -l. - Enter ssh-keygen -t rsa -C three input options will appear one [global user name git's] post, simply press the Enter key to the next step, when the task is executed, the console input address suffix pub file, find pub file suffix, under the SSH public key code or github account in the cloud, the new public key will be to find the contents of the file copied to the new pub public key to generate a new public key.
- git push --set-upstream origin master project can submit code to a remote address.