有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
当前回答
工作命令
git fetch origin 'remote_branch':'local_branch_name'
git switch 'local_branch_name'
git pull origin 'remote_branch':'local_branch_name'
第一个是从远程分支获取分支和创建本地分支。
第二个是转换到当地分行。
第三是将最近的远距离变化推到当地分部。
其他回答
我被困在一个状况中看到error: pathspec 'desired-branch' did not match any file(s) known to git.
以上所有建议。我正在讨论Git 1.8.3.1版本。
所以这个为我工作:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
背后的解释是,我注意到 当我拿起遥控树枝时,时前:
git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD
命令
git fetch --all
git checkout -b <ur_new_local_branch_name> origin/<Remote_Branch_Name>
等于
git fetch --all
时和时
git checkout -b fixes_for_dev origin/development
两者将创造latest fixes_for_dev
调自development
简单运行git checkout
使用远程分支的名称。 Git 会自动自动创建本地分支, 跟踪远程分支 :
git fetch
git checkout test
但是,如果在不止一个远程中发现分支名称, 则无法使用 Git , 因为 Git 不知道该使用哪个 。 在这种情况下, 您也可以使用 :
git checkout --track origin/test
或
git checkout -b test origin/test
内2.19基特学会了checkout.defaultRemote
配置, 它指定了在解决此模糊性时默认的远程 。
我用了那个:
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
git fetch --all
将所有远程分支都带回您的本地
git checkout test
将您切换到测试分支