我是Git的新手。我正在创建一个分支,然后想将它推送到origin。我认为只需发出gitpush(站在我的分支上)就足够了。这样做是否可能/合理(通过指定push.defaultsimple)? 最佳答案 第一次推送应该是:gitpush-uoriginbranchname这将确保:您本地的分支机构有一个remotetrackingbranch同名引用upstreambranch在你的远程仓库'origin',这符合defaultpushpolicy'simple'任何future的gitpush都将使用该默认策略仅推送当前分支,并
最好在示例中进行解释:我在存储库的分支0.58上,这是他的pull方式:gitpullorigin0.58当我调用“gitpull”时,我得到:ip238:openlieroxaz$gitpullYouaskedmetopullwithouttellingmewhichbranchyouwanttomergewith,and'branch.0.58.merge'inyourconfigurationfiledoesnottellmeeither.Pleasenamewhichbranchyouwanttomergeonthecommandlineandtryagain(e.g.'git
最好在示例中进行解释:我在存储库的分支0.58上,这是他的pull方式:gitpullorigin0.58当我调用“gitpull”时,我得到:ip238:openlieroxaz$gitpullYouaskedmetopullwithouttellingmewhichbranchyouwanttomergewith,and'branch.0.58.merge'inyourconfigurationfiledoesnottellmeeither.Pleasenamewhichbranchyouwanttomergeonthecommandlineandtryagain(e.g.'git
我的git存储库中有一些旧分支不再处于活跃开发状态。我想归档分支,以便它们在运行gitbranch-l-r时不会默认显示。我不想删除它们,因为我想保留历史。我该怎么做?我知道可以在refs/heads之外创建一个ref。例如,refs/archive/old_branch。这样做有什么后果吗? 最佳答案 我认为正确的做法是标记分支。如果您在标记分支后将其删除,那么您就有效地保留了该分支,但它不会弄乱您的分支列表。如果您需要返回分支机构,只需查看标签即可。它将有效地从标签中恢复分支。归档和删除分支:gittagarchive/gitb
我的git存储库中有一些旧分支不再处于活跃开发状态。我想归档分支,以便它们在运行gitbranch-l-r时不会默认显示。我不想删除它们,因为我想保留历史。我该怎么做?我知道可以在refs/heads之外创建一个ref。例如,refs/archive/old_branch。这样做有什么后果吗? 最佳答案 我认为正确的做法是标记分支。如果您在标记分支后将其删除,那么您就有效地保留了该分支,但它不会弄乱您的分支列表。如果您需要返回分支机构,只需查看标签即可。它将有效地从标签中恢复分支。归档和删除分支:gittagarchive/gitb
当我尝试使用gitpushorigin:branchname推送到远程git分支以将其删除时,我收到以下错误消息:error:unabletopushtounqualifieddestination:remotes/origin/branchnameThedestinationrefspecneithermatchesanexistingrefontheremotenorbeginswithrefs/,andweareunabletoguessaprefixbasedonthesourceref.但是当我输入gitbranch-a时,我仍然在remotes/origin/branchn