[英]i have two local repos, one at school one at home, and the remote repo on github, how do i get commits from one local repo to sync to the other local
as stated in the title i have two local repos on two different machines and one github repo synced with both of them remotely, how do i make it so that when i make a change in local repo 1, commit stage and push it to the remote repo, that those changes will update local repo 2 without having to completely remove and reconfig it on the pc.如标题中所述,我在两台不同的机器上有两个本地存储库,一个 github 存储库与它们远程同步,我如何做到这一点,以便当我在本地存储库 1 中进行更改时,提交阶段并将其推送到远程repo,这些更改将更新本地 repo 2,而无需在 PC 上完全删除和重新配置它。 this is probably a noob question but im a noob to github and when i looked into it i tried most of the different commands etc but almost every time i tried any of them i just got the error message 'fatal: not a gir repository (or any of the parent directories): .git.
这可能是一个菜鸟问题,但我是 github 的菜鸟,当我查看它时,我尝试了大多数不同的命令等,但几乎每次我尝试其中任何一个时,我都收到错误消息“致命:不是 gir 存储库(或任何父目录):.git。
Your problem is the reason, why there is Git.你的问题是原因,为什么有 Git。 Local repositories (copies) on different computers (at all team-members, or in your case: home and school) and ONE remote repository.
不同计算机上的本地存储库(副本)(所有团队成员,或者您的情况:家庭和学校)和一个远程存储库。 In your situation there is no team who works together on one repository, there are only two station (same user), where you have clone the same repository.
在您的情况下,没有团队在一个存储库上一起工作,只有两个工作站(同一用户),您可以在其中克隆同一个存储库。 But you must handle this as you work in a team.
但是当你在团队中工作时,你必须处理这个问题。
Now if you made changes, you will commit this changes and push it to remote.现在,如果您进行了更改,您将提交此更改并将其推送到远程。 That the other members who works with on this repository (or your other local station (home-school)) become the changes from remote to local, they must pull this changes, that the local repository is up-to-date with the remote.
在此存储库(或您的其他本地站(家庭学校))上工作的其他成员成为从远程到本地的更改,他们必须拉取此更改,本地存储库与远程存储库保持同步。 And that you can do with
git pull
.你可以用
git pull
做到这一点。
I advise you to do a git tutorial , so that you can handle the most common git commands.我建议你做一个git 教程,这样你就可以处理最常见的 git 命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.