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/

http://stackoverflow.com/questions/2765421/push-a-new-local-branch-to-a-remote-git-repository-and-track-it-too

Git Commands Quick Notes的更多相关文章

  1. Basic Git commands

    Basic Git commands Skip to end of metadata Created by Paul Watson [Atlassian], last modified on Nov ...

  2. [label][git-commands] Several Git Commands

    The process of Git commands Operation 1. git commit -m 'fist post' Windows PowerShellCopyright (C) 2 ...

  3. Git Commands

    Show ssh key file: ssh -v git@github.com

  4. Useful Git Commands for me

    查看Git追踪的文件 git ls-files   移除远程仓库的文件夹 git rm -r --cached some-directory git commit -m "Remove th ...

  5. Very Good Article on How Git Commands Work

    http://stackoverflow.com/questions/30038999/differences-between-commit-commit-and-push-commit-and-sy ...

  6. Quick Notes

    激励 每当在书中读及那些卑微的努力,都觉得感动且受震撼.也许每个人在发出属于自己的光芒之前,都经历了无数的煎熬,漫长的黑夜,无尽的孤独,甚至不断的嘲讽和否定,但好在那些踮脚的少年,最后都得到了自己想要 ...

  7. Git for Windows v2.11.0 Release Notes

    homepage faq contribute bugs questions Git for Windows v2.11.0 Release Notes Latest update: December ...

  8. git submodule 使用

    这个是备忘录,原网页: https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407 http://cncc.bingj.c ...

  9. 实践中的Git常用指令分析

    从工作开始,一直都在使用为知笔记(作为程序员需要知道的内容很多---不需要很深入理解,一段时不使用的东西可能就会忘记).但本周一同步不同PC端时,了解到为知会在2017/1/1开始收费! 既然收费了, ...

随机推荐

  1. spark 官方文档(1)——提交应用程序

    Spark版本:1.6.2 spark-submit提供了在所有集群平台提交应用的统一接口,你不需要因为平台的迁移改变配置.Spark支持三种集群:Standalone.Apache Mesos和Ha ...

  2. 中文编程语言Z语言开源正式开源!!!

    (Z语言基于.NET环境,源码中有很多高技术的代码,让更多的人知道对大家有会有很好的帮助,请管理员一点要批准放在首页) 本人实现的中文编程语言Z语言现在正式开源,采用LGPL协议. 编译器核心的网址为 ...

  3. angularjs $scope.$apply 方法详解

    myApp.controller('firstController',function($scope,$interval){ $scope.date = new Date(); setInterval ...

  4. enum 与 enum class

    c++11中引入了新的枚举类型---->强制枚举类型 // unscoped enum: enum [identifier] [: type] {enum-list};  // scoped e ...

  5. 自己常用的webstrom快捷键

    1.ctrl+"d" 复制正行 2.ctrl+"y" 删除正行 3.ctrl+"-" 缩小整块 4.ctrl+"+" 扩 ...

  6. idea开发工具破解地址

    链接失效可以使用激活码.激活码不需要联网也可以开发. idea 在注册时选择 License server ,填http://idea.iteblog.com/key.php ,然后点击激活. 激活码 ...

  7. Mac地址

    Mac地址是每张网卡的唯一标识符,也叫物理地址.硬件地址或链路地址,由网络设备制造商生产时烧在网卡的ROM中,可以修改.现在的Mac地址一般都采用6字节48bit(还有2字节16bit的Mac地址,多 ...

  8. 响应者链条,如何获取最佳的点击view 以及内部实现

    事件的产生与传递 事件是如何产生与传递的? 当发生触摸事件后,系统会将该事件加入到一个由UIApplication管理的事件队列中. UIApplication会从时间队列中取出最前面的时间,并将事件 ...

  9. UIStackView before iOS9.0

    我用的Xcode8.1,同伴用的Xcode7.3.1,其上传了几个XIB文件,导致我这边项目一直爆红,爆红信息:"UIStackView before iOS9.0".如图: 网上 ...

  10. 解决java.lang.NoClassDefFoundError: org/objectweb/asm/util/TraceClassVisitor

    方案一: <dependency> <groupId>asm</groupId> <artifactId>asm-all</artifactId& ...