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. HTML5存储之 indexedDB

    IndexeDB是HTML5 重要的一部分,它是一种轻量级的NOSQL数据库.对创建具有丰富本地存储数据的数据密集型的离线HTML5 Web 应用程序很有用. IndexedDB是为了能够在客户端存储 ...

  2. js 对数据转换成数据容量单位

    function bytesToSize(value) { alert(value); alert('value'); debugger; if (value === 0) return '0 B'; ...

  3. Linux下的压缩和解压缩命令——zip/unzip

    zip命令 zip是个使用广泛的压缩程序,文件经它压缩后会另外产生具有".zip"扩展名 的压缩文件. 选项: -A   调整可执行的自动解压缩文件. -b<工作目录> ...

  4. wget 断点续传 & nginx文件服务器

    nginx默认支持断点续传: 测试方法: wget -S http://httpd.apache.org/images/httpd_logo_wide_new.png 2>&1 | gr ...

  5. jquery的checkbox,radio,select等方法总结

    jquery的checkbox,radio,和select是jquery操作的一个难点和重点,很多前端新手对其了解不是很透彻.时间久了不用,我在写的时候有时也难免对某些操作支支吾吾,记不清楚,现在,对 ...

  6. php链接数据库 批量删除 和 注册审核

    理解 :  hiden   value    session   name="a[]"         1.  form  表单上传的 value=" "值   ...

  7. 解决Maven项目pom.xml文件报xxx\target\classes\META-INF\MANIFEST.MF (系统找不到指定的路径。)问题

    最近自己在公司项目修改一些代码以后,出现如题的错误,后来各种Google等,最终找到了解决办法. 错误环境:Tomcat7 + Eclipse + Maven + Spring + SpringMvc ...

  8. TO BUY

    // book 人月神话 // hardware 乐视.凯酷一生黑 HHKB 白无刻 Filco 奶酪绿 G600 // Book 重构 改善既有代码的设计 java与模式 人月神话(40周年中文纪念 ...

  9. EXT.JS的PROXY放在哪里,STORE放在哪里,绝对是个技术活儿啊。

    我理解的是,单独的STORE,会在应用程序开始时就加载, 而VIEWMODEL的STORE,会在VIEW加载时才开始加载. PROXY放在STORE,则会在调用这个STORE的VIEW才能请求服务器数 ...

  10. 解决apache 443端口被占用

    检测 错误 httpd.exe -w -n "apache" -k start , 进入Apache的安装目录, 搜索httpd-ssl.conf,httpd-ahssl.conf ...