草庐IT

git - 在 git push 上硬重置

我在要推送的远程仓库上有一个接收后Hook脚本,它执行gitreset--hard像这样:$gitpushopalCountingobjects:74,done.Deltacompressionusingupto2threads.Compressingobjects:100%(45/45),done.Writingobjects:100%(53/53),16.68KiB,done.Total53(delta20),reused0(delta0)remote:warning:updatingthecurrentbranchremote:HEADisnowat88f1e35tweaklav

git - 我无法 push git?

gitpushoriginmaster显示错误failedtopushsomerefsto'git@github.com:xyz/abc.git'Topreventyoufromlosinghistory,non-fast-forwardupdateswererejectedMergetheremotechangesbeforepushingagain.Seethe'Noteaboutfast-forwards'sectionof'gitpush--help'fordetails.这是什么?如何恢复? 最佳答案 参见"pushing

混帐 1.8 : it push error: dst ref refs/heads/master receives from more than one src

git1.8的另一个问题:$gitpusherror:dstrefrefs/heads/masterreceivesfrommorethanonesrc.error:failedtopushsomerefsto'gitosis@xxx.xx:xxx.git'建议?它在升级到1.8之前一直有效。$gitremote-vorigingitosis@xxx.xx:xxx.git(fetch)origingitosis@xxx.xx:xxx.git(push)谷歌搜索后我首先尝试了这个:$gitpushorigin:refs/heads/refs/heads/masterremote:warn

git push 对于一个分支来说非常慢

我们有一个非常大的git存储库(ios应用程序资源)。我明白git在使用它时会变慢,但如果我创建一个新分支并编辑几个文件(不是二进制文件)并推送,它会花费很长时间。感觉整个repo都在push了。我的印象是git只会发送差异,这是错误的吗?(我知道git存储整个文件的压缩版本,我的意思是我的分支和我分支的地方之间的差异)。如果我运行gitdiff--stat--cachedorigin/foo然后我会看到一个简短的文件列表,看起来像我所期望的,例如34​​个文件已更改,1117个插入(+),72个删除(-)。但是当我push它到达Writingobjects:21%(2317/1080

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

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

git - "git push"是否推送来自其他分支的所有提交?

如果我有许多未推送的提交分布在本地仓库的许多分支中,如果我键入gitpush会发生什么?将推送所有这些提交还是仅推送属于当前分支的提交? 最佳答案 不,gitpush仅将提交从当前本地分支推送到您在命令中指定的远程分支。您可以通过设置--all参数告诉g​​it推送所有分支参见commanddescription 关于git-"gitpush"是否推送来自其他分支的所有提交?,我们在StackOverflow上找到一个类似的问题: https://stacko

git - 为什么我们需要先 git push 再 git pull?

我有本地更改和远程更改。有人告诉我必须先推,再pull。这背后有什么原因吗? 最佳答案 那个人错了:正确的模型是pull-before-you-push,而不是相反。当您pull时,git将获取origin上的提交并尝试快进您的本地在它们之上提交,进行merge。之后您可以push,这样您就不会与其他更新产生冲突。 关于git-为什么我们需要先gitpush再gitpull?,我们在StackOverflow上找到一个类似的问题: https://stacko

git push/pull 超时

我无法从我的公司vpngitpush/pull到github:gitpushoriginmasterssh:connecttohostgithub.comport22:Connectiontimedoutfatal:Theremoteendhungupunexpectedly我假设这是一个防火墙问题,b/c如果我断开与vpn的连接它会工作。我可以做些什么来解决它吗?或者当我需要推/pull时我是否卡住了与vpn的连接? 最佳答案 不确定您使用的是哪种类型的VPN,但这种影响通常是由于VPN设置通过VPN路由您的所有流量。你可以通过更

git - 为什么git在这个git push中要push到两个分支?

什么可能导致“gitpush”尝试提交到两个分支?我有自己的分支机构,它在共享仓库中……还有一个主分支机构。现在我只想推送到我的个人分支,这很好,但它也试图推送到master并被拒绝。看起来像这样:foo$gitpushCountingobjects:38,done.Deltacompressionusing2threads.Compressingobjects:100%(19/19),done.Writingobjects:100%(21/21),9.73KiB,done.Total21(delta14),reused0(delta0)Tossh://example.com/proj

git - 如何自动化 "commit-and-push"进程? (git)

我有一个git仓库。在我对代码库进行每次重大更改后,我所做的就是转到终端并执行一组命令。gitadd.gitcommit-m'somemessage'gitpushoriginmaster每天都是一样的,过程挺无聊的。谁能建议一种以某种方式自动执行此过程的方法?我正在运行LinuxMint14操作系统。 最佳答案 您可以使用Bash脚本非常轻松地自动执行此操作。gitadd.echo'Enterthecommitmessage:'readcommitMessagegitcommit-m"$commitMessage"echo'Ent