Git Commands Quick Notes
2024-09-30 02:40:44
Fetch
This command is to make sure your local repository has the same knowledge of the remote-tracking branches as the server.
git fetch <remote name>
Check out a Remote Branch
If a new remote branch doesn't have a local branch mapped to it, you need to check out the remote branch locally to work on it. The complete command is,
git checkout -b <local branch name> <remote name>/<remote branch name>
If you want to fetch all the branches on the server
git branch -v -a
References:
http://stackoverflow.com/questions/1783405/checkout-remote-git-branch
Push
Push changes to remote. (If the remote doesn't have the branch, the branch will be created)
git push <remote name> <branch name>
Renaming a branch (a complete version of push command)
This can delete a remote branch by providing empty local branch name.
git push <remote name> <local branch name>:<remote branch name>
References:
https://help.github.com/articles/pushing-to-a-remote/
最新文章
- iOS5.0以上使用新浪微博开放平台OAuth 续(及解决登录无效问题)
- Python第二模块(文件和函数)
- 小说一下case ~
- [转载]窗口之间的主从关系与Z-Order
- POJ 2195:Going Home(最小费用最大流)
- 【20160924】GOCVHelper MFC增强算法(4)
- iq 格式分析
- StyleCop学习笔记——默认的规则
- SQL —— 一些需要注意的地方(持续更新)
- 文件中的类都不能进行设计,因此未能为该文件显示设计器。设计器检查出文件中有以下类: FormMain --- 未能加载基类“WinForm.Win.FormsBase.FormMainBase”。请确保已引用该程序集并已生成所有项目
- python中如何使用help命令?
- 寻找大学目标及行动步骤——记ITAEM团队第二期宣讲会(2014.05.14)
- DevExpress 学习使用之 TreeList
- hadoop源码调试
- maven web工程缺少 src/main/java 和 src/test/java 资源文件夹的方法
- jeffy-vim-v3.1.tar.gz
- Scrapy学习篇(七)之Item Pipeline
- ArcGIS案例学习笔记4_1_水文分析
- 笔记:使用mailto在网页中链接Email地址
- spring mvc接收数组