简体   繁体   English

在git中同步分支

[英]Sync branches in git

I'm sure this is a simple one but I haven't been able to find the answer online, even after much Googling. 我敢肯定这是一个简单的方法,但是即使经过大量Google搜索,我也无法在线找到答案。

I have Git installed on my machine, for which I followed the tutorial on the Github site. 我已经在机器上安装了Git,并按照Github网站上的教程进行操作。 Following this made my machine master. 在此之后,我的机器成为了大师。 Now, I need to work on a different branch. 现在,我需要在另一个分支上工作。 So I created a new branch on the site. 因此,我在网站上创建了一个新分支。 Problem: this new branch isn't showing up in the Bash window, and when I try to switch to it, it isn't recognized. 问题:此新分支未显示在Bash窗口中,并且当我尝试切换到该分支时,无法识别它。 A coworker created his branch and it isn't on my machine either. 一位同事创建了他的分支,该分支也不在我的计算机上。

How can I synchronize the list of branches on the site with my machine? 如何将站点上的分支机构列表与我的机器同步?

Thanks! 谢谢!

to get other's branch repositories on your local system, make a directory of their name on your system and inside it do 要在本地系统上获取其他人的分支存储库,请在您的系统上并在其内部创建一个其名称的目录

$git init 
$git clone <git repo url>

you can find the repo url in the github site. 您可以在github网站上找到回购网址。

for clarifying your basic git concepts follow this site: 为了阐明您的基本git概念,请访问以下网站:

http://gitimmersion.com/ http://gitimmersion.com/

Got it actually, I just needed to do 知道了,我只需要做

$git fetch --all

and then I could switch to it fine. 然后我可以切换到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM