We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
参考资料
回滚版本:git reset —hard HEAD^
回退暂存区为线上版本:git reset HEAD file
切换分支是否会改变本地文件
查看工作区和版本库里面最新版本的区别:git diff HEAD -- readme.txt
放弃工作区的修改
查看文件内容:cat file
删除文件
创建 SSH Key:
查看log
git log
git reflog
git log --graph --pretty=oneline
git log --graph --pretty=oneline --abbrev-commit
git log --graph
关联远程仓库: git remote add origin(远程仓库的名字) git@github.com:michaelliao/learngit.git
查看分支:git branc
创建分支:git branch
切换分支:git checkout
创建+切换分支:git checkout -b
合并某分支到当前分支:git merge
删除分支:git branch -d
git push
git push <远程主机名> <本地分支名>:<远程分支名>
git push origin master
git push origin :master
-u
git push -u origin master
simple
matching
git config --global push.default matching
git config --global push.default simple
—all
git push --all origin
git pull
—force
git push --force origin
git push origin —tags
git clone
Git远程操作详解
The text was updated successfully, but these errors were encountered:
No branches or pull requests
参考资料
回滚版本:git reset —hard HEAD^
回退暂存区为线上版本:git reset HEAD file
切换分支是否会改变本地文件
查看工作区和版本库里面最新版本的区别:git diff HEAD -- readme.txt
放弃工作区的修改
查看文件内容:cat file
删除文件
创建 SSH Key:
查看log
git log
git reflog
git log --graph --pretty=oneline
git log --graph --pretty=oneline --abbrev-commit
git log --graph
关联远程仓库: git remote add origin(远程仓库的名字) git@github.com:michaelliao/learngit.git
查看分支:git branc
创建分支:git branch
切换分支:git checkout
创建+切换分支:git checkout -b
合并某分支到当前分支:git merge
删除分支:git branch -d
git push
git push <远程主机名> <本地分支名>:<远程分支名>
git push origin master
git push origin :master
git push
-u
设置默认主机git push -u origin master
simple
和matching
方式simple
方式只推送当前分支matching
方式推送所有有对应远程分支的本地分支git config --global push.default matching
、git config --global push.default simple
—all
选项git push --all origin
git pull
,如果一定要推送,使用—force
选项git push --force origin
git push origin —tags
git clone
Git远程操作详解
The text was updated successfully, but these errors were encountered: