Git/Github tips

Github配置

Github上同步fork和orignal

同步master

  1. git remote -v
  2. git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
  3. git remote -v
  4. git fetch upstream
  5. git checkout master
  6. git merge upstream/master

同步branch

  1. git checkout upstream/{branch}
  2. git checkout -b {local_branch}
  3. git merge upstream/{branch} {local_branch}

命令别名

https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

  • git config --global alias.co checkout
  • git config --global alias.br branch
  • git config --global alias.ci commit
  • git config --global alias.st status

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容