有人将一个名为testwith 的分支推git push origin test送到共享存储库.我可以看到分支git branch -r.
现在我正试图检查远程test分支.
我试过了:
git checkout test 什么都不做
git checkout origin/test给* (no branch).这令人困惑.我怎么能在"没有分支"?
如何查看远程Git分支?
我的同事和我在同一个存储库上工作,我们已经将它分成两个分支,每个分支在技术上用于不同的项目,但是它们有相似之处,所以我们有时会想要master从... 返回到*branch.
但是,我有branch.我的问题是,我的同事怎么能专门拉那个分支?
一个git clone回购似乎并不在本地创建分支的他,虽然我可以在我结束推后住上unfuddle看到它们.
此外,当我最初创建分支时,我做了-b checkout.不确定这是否有很大的不同?
$ git branch -r
origin/HEAD -> origin/master
origin/daves_branch
origin/discover
origin/master
$ git fetch origin discover
$ git checkout discover
Run Code Online (Sandbox Code Playgroud)
这些是我跑的命令.但它绝对不起作用.
我希望能够检查该分支,然后推送并提交来自各个协作者或工作站的分支更改.
我在Git中创建了一个新分支:
git branch my_branch
Run Code Online (Sandbox Code Playgroud)
推它:
git push origin my_branch
Run Code Online (Sandbox Code Playgroud)
现在说有人在服务器上做了一些更改,我想从中拉出来origin/my_branch.我做:
git pull
Run Code Online (Sandbox Code Playgroud)
但我得到:
You asked me to pull without telling me which branch you
want to merge with, and 'branch.my_branch.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like …Run Code Online (Sandbox Code Playgroud) 我有时会使用该checkout -b选项创建一个新分支,同时检查它并在一个命令中设置跟踪.
在新环境中,我收到此错误:
$ git checkout -b test --track origin/master
fatal: Cannot update paths and switch to branch 'test' at the same time.
Did you intend to checkout 'origin/master' which can not be resolved as commit?
Run Code Online (Sandbox Code Playgroud)
为什么Git不喜欢它?这曾经使用相同的回购.
我有了另一个远程回购upstream之外origin.我能做到git checkout origin/master,但是当我跑步时git checkout upstream/master,我得到:
error: pathspec 'upstream/master' did not match any file(s) known to git.
Run Code Online (Sandbox Code Playgroud)
这也不起作用:
$ git fetch upstream
From https://github.com/getsentry/sentry
* branch HEAD -> FETCH_HEAD
$ git co -b asdf --track upstream/master
fatal: Cannot update paths and switch to branch 'asdf' at the same time.
Did you intend to checkout 'upstream/master' which can not be resolved as commit?
Run Code Online (Sandbox Code Playgroud)
如何在upstream远程检查远程分支origin?我的git版本是2.1.2.
我想基于其他分支创建本地分支.例如我输入:
git checkout -b feature1 release1.1.3
之后我得到:
fatal: git checkout: updating paths is incompatible with switching branches.
这有什么问题?
假设有一个正式的仓库维护称为O分支B1,B2&B3.
一个用户将其分配到他的Github帐户,为自己创建了另一个分支,B4并且是公开的.
我也分叉了相同的官方回购,但我想在B4不影响原始副本的情况下分叉该用户的分支.
因为我为自己制作了几个自定义分支,所以我无法再次分发整个官方仓库.
那么,我如何将特定分支分支到我的Github仓库?
当使用Hudson的Git插件时,我的作业总是在从我的在线git存储库中获取最新的源代码时失败(git://github.com/ithena/orm2dsl.git).
git插件首先git fetch成功执行.然后它尝试执行git checkout -f origin/,失败,如下所示.这是我的git存储库的问题还是没有意义的checkout命令?
Git命令没有在作业配置中设置的分支:
git checkout -f origin/
git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout 'origin/' which can not be resolved as commit?
Run Code Online (Sandbox Code Playgroud)
在作业配置中将分支设置为master的Git命令:
git checkout -f origin/master
git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout 'origin/master' which can not be resolved as commit?
Run Code Online (Sandbox Code Playgroud)
Hudson控制台输出:
started
Checkout
[workspace] $ git fetch
Checking out origin/
[workspace] $ git checkout …Run Code Online (Sandbox Code Playgroud) set -e
cd /source
git clone --depth 1 https://github.com/named-data/ndn-cxx.git
pushd ./ndn-cxx
git checkout -b release-build ndn-cxx-0.3.3
./waf configure
./waf
./waf install
popd
rm -rf ./ndn-cxx
Run Code Online (Sandbox Code Playgroud)
我正在运行上述脚本,但收到错误:“克隆到 'ndn-cxx'... /source/ndn-cxx /source 致命:无法同时更新路径并切换到分支 'release-build' . 您是否打算签出无法解析为提交的 'ndn-cxx'?
我有2个遥控器-原产地指向我的叉子和上游到公司回购该点。
$git remote -v
origin https://github.com/me/app.git (fetch)
origin https://github.com/me/app.git (push)
upstream https://github.com/company/app.git (fetch)
upstream https://github.com/company/app.git (push)
Run Code Online (Sandbox Code Playgroud)
我分叉前一个月。我一直在推动原点,然后向上游提出拉取请求。这很好。
现在有人在上游创建了一个名为“3D_Theory”的分支,我想首先将该新分支反映到我的原点,然后从该分支开始工作。但出于某种原因,该分支并没有反映在我的起源中。
我尝试了以下方法:
git remote show origin
>> does not list 3D_Theory
git remote show upstream
>> lists 3D_Theory
Run Code Online (Sandbox Code Playgroud)
我试过:
git fetch upstream
git checkout master
git merge upstream/3D_Theory
Run Code Online (Sandbox Code Playgroud)
但是我仍然没有在我的叉子上创建那个分支。如何在上游获得一个新分支以反映我的分叉?
谢谢
以下类似问题都没有帮助我:
git ×10
git-branch ×3
git-checkout ×3
github ×3
branch ×2
fork ×1
git-fetch ×1
git-fork ×1
git-merge ×1
hudson ×1