zoukankan      html  css  js  c++  java
  • Git系列之一 git remote

    使用git的时候难免会用到remote tracking,下面简要记录一下在使用git remote时的一些技巧

    (1)add
      $git remote add origin https://github.com/ask/celery.git
      注:暂以celery的git作为示例,celery是一个挺不错的Distributed Task Queue,有很多值得学习的地方,在此也顺便推广一下celery
    (2) show remote
      $git remote show origin
      通过$git remote show origin来得到remote中的所有branch列表
    (3)fetch
      $git fetch --depth=1 origin master
      通过depth来指定获取最近的多少个commit,可以通过这一参数来根据需要限定获取的commit个数
    (4)create branch
      $git branch master
    (5)merge
      $git checkout master
      $git merge FETCH_HEAD
    (6)diff HEAD FETCH_HEAD
      $git diff HEAD FETCH_HEAD,检测当前HEAD和FETCH_HEAD之间的区别,如果有区别的话,可以认为是有更新或者变动,如果想通过git来做autoupdate的话,可以根据diff的结果,决定是否重新fetch
    (7)create empty empty
      $git symbolic-ref HEAD refs/heads/newbranch
      $rm .git/index
      $git clean -fdx
      $<do work>
      git add your files
      $git commit -m 'Initial commit'

  • 相关阅读:
    null和undefined的区别
    "NetworkError: 404 Not Found fontawesome-webfont.woff?v=4.0.3
    php字符串
    php数组
    Oracle 和 MySQL的区别(不完整)
    拦截器和过滤器的区别
    SpringMVC和Struts2的区别
    Redis的介绍
    SpringBoot入门(2)
    SpringBoot入门(1)
  • 原文地址:https://www.cnblogs.com/Jerryshome/p/2245979.html
Copyright © 2011-2022 走看看