美文网首页
Git日常使用命令 / Git daily use comman

Git日常使用命令 / Git daily use comman

作者: Evil_cosey | 来源:发表于2018-10-27 16:50 被阅读0次

Git日常使用命令

1.举个例子,需要 fork 这个项目 https://github.com/tarobjtu/WebFundamentals.git

2.github上 fork, 就会复制一份代码到自己的repo https://github.com/laispace/WebFundamentals.git

3.本地 clone 自己 repo 中的这个项目

$ git clone https://github.com/laispace/WebFundamentals.git

4.添加自己的远程仓库

$ cd WebFundamentals 
$ git remote add laispace https://github.com/laispace/WebFundamentals.git

5.修改代码后进行 push

$ git add --all 
$ git commit -m 'edit some files' 
$ git push

这时候,如果源仓库 tarobjtu 的项目代码进行了更新,而我们自己 fork 下来的代码想要合并这些更新怎么做呢?

6.添加源项目的远程仓库

$ git remote add tarobjtu https://github.com/tarobjtu/WebFundamentals.git
// 这时候可以看到有两个源了 
$ git remote
// laispace
// tarobjtu

7.拉取源仓库的代码到本地

$ git fetch tarobjtu

8.合并源仓库的 master 分支代码到本地

$ git merge tarobjtu/master

9.提交代码到我们自己的仓库

$ git add --all $ git commit -m '合并源仓库代码' $ git push

PS:转自 laispace.com

相关文章

  • Git日常使用命令 / Git daily use comman

    Git日常使用命令 1.举个例子,需要 fork 这个项目 https://github.com/tarobjtu...

  • git,svn命令行

    git,svn命令掌握以下内容,够用. ### git版本控制 $ git config --global use...

  • git 使用三剑客

    git 使用三剑客gitwhy use githow use gitgitflowwhy use git flow...

  • 常用Git命令

    推荐《Pro Git中文|Pro Git英文》 每天都在使用 Git ,但是很多命令记不住。一般来说,日常使用只要...

  • 常用 Git 命令

    我们每天使用 Git ,但是很多命令记不住,这里列出日常可能会使用的一些git命令,方便以后查阅。 git名词解释...

  • 常用 Git 命令清单

    Git 日常使用只要记住下图6个命令,就可以了。 熟练使用,恐怕要记住60~100个命令,下面常用 Git 命令清...

  • 常用 Git 命令清单

    常用 Git 命令清单每天使用 Git ,但是很多命令记不住。 一般来说,日常使用只要记住下图6个命令,就可以了。...

  • Git命令使用

    Git命令使用 前言在使用Git命令之前都使用可视化工具SourceTree操作git,现在需要Git Andro...

  • git常用命令

    一.简介 日常开发中记录经常使用的git命令,方便平时使用。 1.git暂存管理 2.git远程仓库管理 3.查看...

  • Git命令

    帮助 git help [command] 查看用户信息 查看git当前使用的用户: git config use...

网友评论

      本文标题:Git日常使用命令 / Git daily use comman

      本文链接:https://www.haomeiwen.com/subject/pvmdtqtx.html