草庐IT

git push origin master :refs/heads/master what does this do

当我在我的gitolite存储库上创建一个新的存储库时,我总是必须输入以下命令才能开始将代码推送到服务器。gitpushoriginmaster:refs/heads/master它有什么作用?我的猜测是,这与不确定的头部引用有关。谁能给我解释一下? 最佳答案 这个命令分为三个部分:gitpush这会调用推送命令origin这会命名您要推送到的Remote。这是存储在.git/config中的命名Remote之一(您可以使用gitremote列出这些Remote)、URL或token.这意味着当前存储库。master:refs/he

git - 为什么 "git pull"从存储库中获取所有分支但 "git pull origin master"不这样做?

为什么gitpull从存储库中获取所有分支,而gitpulloriginmaster却没有?我很难发现它。这是这两个命令之间唯一的功能区别吗?这样的解释告诉我什么都没有:gitpull=gitfetchorigin+gitmergeorigin/master复制代码gitpulloriginmaster=gitfetchoriginmaster+gitmergeFETCH_HEAD复制代码 最佳答案 后一个命令gitpulloriginmaster告诉git获取并merge特定的master分支(来自名为origin的远程分支,更精

git reset --hard origin/master 失败

尝试丢弃服务器上的更改,并使其与origin/master完全相同:gitfetch--allgitreset--hardorigin/master我之前在同一个repo上做过这个没有问题,但这次它失败了,原因如下:fatal:Couldnotresetindexfiletorevision'origin/master'已尝试以下方法:按照建议删除索引并重置here:rm.git/indexgitreset还建议here某些进程可能会锁定.git\index。杀死进程然后执行gitreset可以修复它,但不确定如何检查远程文件是否有锁定。似乎删除索引文件并重置也会产生相同的效果。让我失

git - 克隆分支 : Remote branch branch-99 not found in upstream origin

这个问题在这里已经有了答案:HowdoIcloneasinglebranchinGit?(26个答案)关闭7年前。如何使用特定的分支名称从git克隆一个分支?我有一个名为branch-99的分支,我的用户名为Istiak。我尝试像这样克隆我的分支:gitclone-bbranch-99git@github.istiak/admin.git我收到这个错误。fatal:Remotebranchbranch-99notfoundinupstreamorigin我做错了什么?

git - 为什么我不能用 git push origin :branchname? 删除远程 git 分支

当我尝试使用gitpushorigin:branchname推送到远程git分支以将其删除时,我收到以下错误消息:error:unabletopushtounqualifieddestination:remotes/origin/branchnameThedestinationrefspecneithermatchesanexistingrefontheremotenorbeginswithrefs/,andweareunabletoguessaprefixbasedonthesourceref.但是当我输入gitbranch-a时,我仍然在remotes/origin/branchn

git - git merge master 和 origin/master 之间的区别?

命令gitmergeorigin/master的结果:javanoob@DELL:~/workspace/PROJECT_One$gitmergeorigin/masterUpdatingd83ef9c..dd520eaerror:Thefollowinguntrackedworkingtreefileswouldbeoverwrittenbymerge:sample.txtPleasemoveorremovethembeforeyoucanmerge.Aborting命令gitmergemaster的结果:javanoob@DELL:~/workspace/PROJECT_One$g

git - 为什么 Git 在我运行 "Not currently on any branch"后告诉我 "git checkout origin/<branch>"?

我试图按照Git:"Notcurrentlyonanybranch."Isthereaneasywaytogetbackonabranch,whilekeepingthechanges?中的说明进行操作但是gitcheckout似乎被破坏了:$gitcheckoutorigin/web-zachHEADisnowat1366cb1...Changedsocssfilesnotignored$gitstatus#Notcurrentlyonanybranch.#Untrackedfiles:#(use"gitadd..."toincludeinwhatwillbecommitted)##

git - 如何删除远程 origin/refs/heads/master

别问我怎么做到的,但我在git存储库中意外地获得了以下远程分支:$gitbranch-rorigin/HEAD->origin/masterorigin/masterorigin/refs/heads/master所有都指向同一个提交。如何删除origin/refs/heads/master中不必要的列表?我尝试了以下操作$gitpushorigin:refs/heads/mastererror:dstrefspecrefs/heads/mastermatchesmorethanone.但是如图所示,这给出了一个错误。 最佳答案 这

git - 克隆时 `git` 是否仅命名为 "origin"任何远程?

Git是否只对通过克隆创建的存储库使用远程名称“origin”?例如,假设我创建了一个存储库,将其放在远程服务器上,然后尝试将其再次克隆到同一目录中,Git会将哪个命名为origin? 最佳答案 2010:origin是gitclone使用的默认名称,但您可以在克隆时使用任何其他名称:--origin-oInsteadofusingtheremotenameorigintokeeptrackoftheupstreamrepository,use.如果你不这样做,任何时候你克隆一个repo,那个远程repo将被默认名称引用origin

git push origin 在总消息后挂起

在github上执行gitpushoriginmaster后,推送挂了,没有任何反应。我正在使用https://username@github.com。起初我首先遇到的错误是http.postbuffer太小,我将其更改为http.postbuffer=209715200。现在它卡在Total行之后:Countingobjects:203,done.Deltacompressionusingupto2threads.Compressingobjects:100%(197/197),done.Writingobjects:100%(201/201),49.41MiB|11.07MiB/s