有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :
git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)
有人将称为 Git 推力源测试的分支推向共享仓库 。 我可以看到有 git 分支 -r 的分支 。 我如何查看远程测试分支 ? 我试过 :
git 检出测试, 它不会给 git 检出源/ 测试提供任何结果 * (无分支)
当前回答
工作命令
git 获取源“ remote_ branch ” : “ 本地_ branch_ name” git开关 “ 本地_ branch_ name” git pull 源“ remote_ branch ” : “ 本地_ branch_ name ”
第一个是从远程分支获取分支和创建本地分支。
第二个是转换到当地分行。
第三是将最近的远程更改拖到本地分支。
其他回答
请遵循命令创建空文件夹。 请输入并使用此命令 :
saifurs-Mini:YO-iOS saifurrahman$ git clone your_project_url
Cloning into 'iPhoneV1'...
remote: Counting objects: 34230, done.
remote: Compressing objects: 100% (24028/24028), done.
remote: Total 34230 (delta 22212), reused 15340 (delta 9324)
Receiving objects: 100% (34230/34230), 202.53 MiB | 294.00 KiB/s, done.
Resolving deltas: 100% (22212/22212), done.
Checking connectivity... done.
saifurs-Mini:YO-iOS saifurrahman$ cd iPhoneV1/
saifurs-Mini:iPhoneV1 saifurrahman$ git checkout 1_4_0_content_discovery
Branch 1_4_0_content_discovery set up to track remote branch 1_4_0_content_discovery from origin.
Switched to a new branch '1_4_0_content_discovery'
使用抓取来拉动全部远程
git fetch --all
列表远程分支 :
git branch -r
列表所有您的分支
git branch -l
>>outpots like-
* develop
test
master
要取出/更改分支
git checkout master
i 使用了这一个:
git clean -fxd # removes untracked (new added plus ignored files)
git fetch
git checkout {branchname}
git reset --hard origin/{branchname} # removes staged and working directory changes
i 被困在一个看到错误的情况中: 路径谱“ 想要的分支” 与上述所有建议已知的 Git 匹配的文件不匹配 。 i' 正在 Git 1. 8. 3. 3.1 版本上 。
因此,这对我有效:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
背后的解释是,我已经注意到, 当拿起远程分支时, 它被拿到fick_head:
git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD
您可以在本地端添加新的分支测试,然后使用:
git branch --set-upstream-to=origin/test test