我创建了一个新分支,签出并提交:
git branch my-branch [HASH]
git checkout my-branch
git commit -am "Add some stuff to my new branch"
但是,我不能将其推送到github。git push origin my-branch返回:
error: src refspec branch does not match any.
error: failed to push some refs to 'https://github.com/Me/my-project.git'
我有一个要运行git pull的目录列表
其中一些可能是空的。
当我在它上面运行git pull时,我得到了这个错误:
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.
和1的退出代码
如果任何命令失败,我可以退出我的脚本。
是否可以检测到它是否因此错误而失败?或者有没有其他不会在空仓库上出错的拉取方法?
编辑:.git/config
git:(master) cat .git/config
[core]
r
但是,对于远程分支,以下命令应该会产生相同的输出
git fetch
git branch -a
显示执行时不可见的远程分支
git ls-remote --heads origin
这种行为的原因是什么?
澄清
(TA216441) $ git pull
Your configuration specifies to merge with the ref 'refs/heads/TA216441'
from the remote, but no such ref was fetched.
(TA216441) $ git fetch
(TA216441) $ git br
我正在尝试更新我的啤酒,当我设置
brew更新
我知道这个错误:
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/imagemagick.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/r
在运行git status时,我会收到一个模糊头的警告:
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
On branch develop
Your branch is up to date with 'origin/develop'.
nothing to commit, working tree clean
然而,我似乎没有一个分支,也没有一个名