git - 获得一个项目中不同人的分支
为情所困
为情所困 2017-05-02 09:33:54
0
3
529

获得一个项目中不同人的分支

为情所困
为情所困

reply all(3)
某草草

You can try using Source Tree

伊谢尔伦
  1. First of all, you have to know the name of the remote server of your project, because if you want to get "different people's branches", they first have to push the branch to the server before you can pull it down. (Although it can also be obtained directly through local disk mapping or SSH, these are unconventional methods and should not be considered by you)

    在你的项目下输入 `git config --local --list`,查找 `remote.xxx` 开头的输出,`xxx` 的部分就是服务器的名称,通常都是 `origin`。
    
  2. The second step is to grab the latest changes from the remote server. git pull origin 或者 git fetch origin Both are possible, the former will merge/rebase the tracked local branch directly (it depends on the merge strategy you set, this is not important)

  3. The third step is to check the branch name you need. git branch -a,其中 remotes/ 开头的都是远程分支的名字,假设你想抓取的分支叫做 john-doe,那就应该是 remotes/origin/john-doe.

  4. Finally checkout the branch and create the local corresponding branch. git checkout -b john-doe remotes/origin/john-doe,该命令会创建本地名为 john-doe's branch and automatically switch to it, so you get "different people's branches"

In practice, it doesn’t need to be so complicated, because you can directly ask “others” what the name of the pushed branch is, and then update + check it out.

小葫芦

What are branches of different people? git checkout <branch name>Can’t meet your needs?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!