如何在两台电脑上对一个github回购进行编码? [英] How do I code against one github repo on 2 computers?

查看:125
本文介绍了如何在两台电脑上对一个github回购进行编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台电脑,我想为其中一台github回购做出贡献。我该如何做到这一点?

解决方案

为了让这两个存储库保持同步,您应该在您启动时将最新更改在代码上工作。



要做到这一点,您要执行

  git pull 

...通常设置为从默认远程(原始)拉到当前分支。如果情况并非如此,那么Git可能会抱怨,所以更长的版本也可以运行:

  git pull origin {branch_name注意:这个过程与你使用两个过程相同,如果两个过程相同或更多的人在同一个回购中工作。这基本上是发生了什么,而不是两个不同的人在同一个存储库上工作,你有两个不同的机器在同一个存储库上工作。



如果你刚刚开始新鲜在新机器上,你需要做的就是首先将repo克隆到它:

  git clone {remote_url} 

您从GitHub repo的主页获得此URL。该命令将在子目录中完成repo的完整工作副本。


I have two computers from which I want to contribute to one github repo. How can I accomplish this?

解决方案

To keep both repositories in sync you should to pull the latest changes to your machine whenever you start working on the code.

To do this you want to execute

git pull

...which is usually set up to pull from the default remote (origin) to your current branch. Git might complain if this isn't the case, and so the longer version will work as well:

git pull origin {branch_name}

Note: this is the same process that you would use if two or more people were working on the same repo. Which is essentially what is happening, instead of two different people working on the same repository, you have two different machines working on the same repository.

If you are starting out fresh on a new machine all you need to do is clone the repo to it first:

git clone {remote_url}

You get this url from your GitHub repo's home page. This command will make a complete working copy of the repo in a subdirectory.

这篇关于如何在两台电脑上对一个github回购进行编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆