Git 使用总结
来源:互联网 发布:rndis驱动 windows 10 编辑:程序博客网 时间:2024/06/03 03:17
1. $git diff origin/master master (show me the changes between the remote master branch and my master branch).
需要注意的是,remotes/origin/master和origin/master的指向是相同的
2. $git diff origin/master remotes/origin/master
3. $git push origin master
origin指定了你要push到哪个remote
master其实是一个“refspec”,正常的“refspec”的形式为”+<src>:<dst>”,冒号前表示local branch的名字,冒号后表示remote repository下 branch的名字。
注意,如果你省略了<dst>,git就认为你想push到remote repository下和local branch相同名字的branch。
push就是把本地branch指向的commit push到remote repository下的branch,
比如 $git push origin master:master (在local repository中找到名字为master的branch,使用它去更新remote repository下名字为master的branch,
如果remote repository下不存在名字是master的branch,那么新建一个)
4. $git push origin master (省略了<dst>,等价于“git push origin master:master”)
5. $git push origin master:refs/for/mybranch (在local repository中找到名字为master的branch,用他去更新remote repository下面名字为mybranch的branch)
6. $git push origin HEAD:refs/for/mybranch (HEAD指向当前工作的branch,master不一定指向当前工作的branch,所以我觉得用HEAD还比master好些)
7. $git push origin :mybranch (再origin repository里面查找mybranch,删除它。用一个空的去更新它,就相当于删除了)
- git使用总结(转)
- git使用总结
- git使用总结
- git使用总结
- git使用总结
- git使用总结
- git使用总结
- git使用总结
- git使用总结
- git使用总结
- Git 使用总结
- Git使用总结
- git使用总结
- git使用总结
- git使用总结
- Git使用总结
- git使用总结
- git使用总结
- Linux 文件系统
- 关于=null和clear() 问题(Java性能篇)
- Java初学不可跳过的过程
- Python入门之列表
- 方程式 Eternalblue 漏洞利用复现
- Git 使用总结
- tensorflow_CNN 卷积神经网络_简单教程
- 模板_Bellman-frod算法(最短路径解决负权路问题)
- 测试数据库连接,Jsp连接数据库
- ueditor编辑器使用教程
- 运算符重载详情
- 蓝桥杯 最大最小公倍数
- 1753 数组类Ⅱ
- Opencv SVM车牌识别