Git Commands Quick Notes
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/
Git Commands Quick Notes的更多相关文章
- Basic Git commands
Basic Git commands Skip to end of metadata Created by Paul Watson [Atlassian], last modified on Nov ...
- [label][git-commands] Several Git Commands
The process of Git commands Operation 1. git commit -m 'fist post' Windows PowerShellCopyright (C) 2 ...
- Git Commands
Show ssh key file: ssh -v git@github.com
- Useful Git Commands for me
查看Git追踪的文件 git ls-files 移除远程仓库的文件夹 git rm -r --cached some-directory git commit -m "Remove th ...
- Very Good Article on How Git Commands Work
http://stackoverflow.com/questions/30038999/differences-between-commit-commit-and-push-commit-and-sy ...
- Quick Notes
激励 每当在书中读及那些卑微的努力,都觉得感动且受震撼.也许每个人在发出属于自己的光芒之前,都经历了无数的煎熬,漫长的黑夜,无尽的孤独,甚至不断的嘲讽和否定,但好在那些踮脚的少年,最后都得到了自己想要 ...
- Git for Windows v2.11.0 Release Notes
homepage faq contribute bugs questions Git for Windows v2.11.0 Release Notes Latest update: December ...
- git submodule 使用
这个是备忘录,原网页: https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407 http://cncc.bingj.c ...
- 实践中的Git常用指令分析
从工作开始,一直都在使用为知笔记(作为程序员需要知道的内容很多---不需要很深入理解,一段时不使用的东西可能就会忘记).但本周一同步不同PC端时,了解到为知会在2017/1/1开始收费! 既然收费了, ...
随机推荐
- dubbo实践
最近公司准备重构内部服务模块,准备使用dubbo,故研究一下. 官方文档:http://alibaba.github.io/dubbo-doc-static/Home-zh.htm 1. 用maven ...
- js 控制文本只能输入数字
代码如下: <input onkeypress="setNumber()"><script> function setNumber(){ var keyCo ...
- xml读取节点
<?xml version="1.0" encoding="utf-8"?> <tplcd type=" product=" ...
- Python目录
- 《PHP数组函数》笔记
① in_array() 检查数组中是否存在某个值;有两个参数,第一个参数是要查找的值,第二个参数是数组名,返回值为布尔,找到则ture否则false; ② array_search 在数组中搜索给定 ...
- redis lua
需求是在缓存最近一周内用户所有消息列表,考虑用Redis 存储:为每个存储一个独立Sorted Set,value 为消息体,Score 为MessageId,用以实现增量消息同步. 问题就来了:So ...
- 33个超级有用必须要收藏的PHP代码样例
作为一个正常的程序员,会好几种语言是十分正常的,相信大部分程序员也都会编写几句PHP程序,如果是WEB程序员,PHP一定是必备的,即使你没用开发过大型软件项目,也一定多少了解它的语法. 在PHP的流行 ...
- springmvc+mybatis事务回滚
spring-mybatis.xml中 配置了 <!-- 拦截器方式配置事物 --> <tx:advice id="transactionAdvice" tran ...
- linux 环境变量
电脑中必不可少的就是操作系统.而Linux的发展非常迅速,有赶超微软的趋势.这里介绍Linux的知识,让你学好应用Linux系统.比如要把/etc/apache/bin目录添加到PATH中,方法有三: ...
- 让“是男人就下到100层”在Android平台上跑起来
原工程:https://github.com/jeekun/DownFloors 移植后的代码:HelloCpp.zip 移植后的APK:HelloCpp.apk 说明:(cocos2d-x版本是“ ...