git 常用命令整理

>git常用命令整理,个别难的命令,结合git给的提示,多数可以搞定:
git add . //提交所有改动文件
git commit -m "change content" //说明改动内容
git pull
git push
git push origin
git branch -a
git chekcout branchA
git checkout -b branchNew
git tag //查看tag
git tag V1.1.0 //打tag
git tag -d V1.1.0 //删除本地tag
git push --tag //本地tag推送
git push origin --tags //远程tag推送
git log --decorate
git push origin --delete tag V1.1.0 //删除远程tag

>git 远程代码回退:
git reflog
git reset --hard commitId
git push -f

>git use:
cd ~/.ssh
ssh-keygen
git config --global user.name "your username" //配置用户名
git config --global user.email "your email" //配置邮箱
git passphrase:"your password"

>//git clone repo:
git clone https://github.com/supnate/react-geek-time.git

>把本地库的所有内容推送到远程仓库(GitHub新建好的库)
git remote add origin https://github.com/begin256/webpack-learn.git
git branch --set-upstream-to=origin/master master
git pull --rebase origin master
git push -u origin master

>git pull = git fetch + git merge
git pull --rebase = git fetch + git rebase
原文地址:https://www.cnblogs.com/begin256/p/10614532.html