草庐IT

git - 如何撤消 "git push --mirror"?

在一个git/github项目上,我正在一个分支上工作。一推,它说了以下内容:gitpushTogit@github.com:...![rejected]master->master(non-fast-forward)error:failedtopushsomerefsto'git@github.com:...'Topreventyoufromlosinghistory,non-fast-forwardupdateswererejectedMergetheremotechangesbeforepushingagain.Seethe'Noteaboutfast-forwards'sect

git - 如何撤消 "git push --mirror"?

在一个git/github项目上,我正在一个分支上工作。一推,它说了以下内容:gitpushTogit@github.com:...![rejected]master->master(non-fast-forward)error:failedtopushsomerefsto'git@github.com:...'Topreventyoufromlosinghistory,non-fast-forwardupdateswererejectedMergetheremotechangesbeforepushingagain.Seethe'Noteaboutfast-forwards'sect

git - 干净的工作树下 `git branch -f <branch_name> <hash>` 和 `git checkout <branch_name>; git reset --hard <hash>` 之间的区别?

到目前为止,我一直使用gitcheckout;gitreset--hard将分支移回较早的提交。然后我遇到了thisquestion,但答案和评论并没有详细解释它们之间的区别。假设我有一个干净的工作树,它们之间有什么内部差异gitbranch-f和gitcheckoutgitreset--hard这些差异(如果有的话)对高级用法有什么微妙的影响吗? 最佳答案 主要区别在于gitbranch-f移动指向指定的提交而不触及HEAD、索引或工作副本,而gitcheckout&&gitreset--hard修改所有三个。如果你想在不移动的情

git - 干净的工作树下 `git branch -f <branch_name> <hash>` 和 `git checkout <branch_name>; git reset --hard <hash>` 之间的区别?

到目前为止,我一直使用gitcheckout;gitreset--hard将分支移回较早的提交。然后我遇到了thisquestion,但答案和评论并没有详细解释它们之间的区别。假设我有一个干净的工作树,它们之间有什么内部差异gitbranch-f和gitcheckoutgitreset--hard这些差异(如果有的话)对高级用法有什么微妙的影响吗? 最佳答案 主要区别在于gitbranch-f移动指向指定的提交而不触及HEAD、索引或工作副本,而gitcheckout&&gitreset--hard修改所有三个。如果你想在不移动的情

git - 如何在 Visual Studio 2015 中创建新分支?

我在VisualStudio2015中将Git与VisualStudioOnline结合使用,并试图弄清楚如何创建分支。这是互联网上常见的答案:https://msdn.microsoft.com/en-us/library/hh850437.aspx&https://msdn.microsoft.com/en-us/library/jj190809.aspx#create如果您检查图像,它会显示分支和下pull箭头,我认为您可以在其中创建分支。但在VisualStudio2105中,下pull菜单不存在,当我单击链接时,它会转到分支。但是只有Merge、Rebase和Actions下

git - 如何在 Visual Studio 2015 中创建新分支?

我在VisualStudio2015中将Git与VisualStudioOnline结合使用,并试图弄清楚如何创建分支。这是互联网上常见的答案:https://msdn.microsoft.com/en-us/library/hh850437.aspx&https://msdn.microsoft.com/en-us/library/jj190809.aspx#create如果您检查图像,它会显示分支和下pull箭头,我认为您可以在其中创建分支。但在VisualStudio2105中,下pull菜单不存在,当我单击链接时,它会转到分支。但是只有Merge、Rebase和Actions下

git checkout my_branch 与 git checkout origin/my_branch

当我像这样检查branch2时,我在branch1上(两个分支都存在)。gitcheckoutorigin/branch2然后我得到一个分离的头错误:Youarein'detachedHEAD'state.Youcanlookaround,makeexperimentalchangesandcommitthem,andyoucandiscardanycommitsyoumakeinthisstatewithoutimpactinganybranchesbyperforminganothercheckout.但是我只是检查branch2(没有origin)然后它工作正常:gitcheck

git checkout my_branch 与 git checkout origin/my_branch

当我像这样检查branch2时,我在branch1上(两个分支都存在)。gitcheckoutorigin/branch2然后我得到一个分离的头错误:Youarein'detachedHEAD'state.Youcanlookaround,makeexperimentalchangesandcommitthem,andyoucandiscardanycommitsyoumakeinthisstatewithoutimpactinganybranchesbyperforminganothercheckout.但是我只是检查branch2(没有origin)然后它工作正常:gitcheck

git - 组织 git 分支

我有一个大型项目,我正在使用git作为VCS。在任何给定时间,我都在努力实现一些功能/错误修复等。对于任何给定的功能/错误,创建分支层次结构会很好——例如$gitbranchfeature1sub-branch1sub-branch2sub-branch3feature2sub-brancha*sub-branchb#是否可以这样做,还是我需要采用更原始的命名方案?编辑为了使我正在寻找的内容更具体一些,如果feature1是一个git分支,那么在上面的示例中,子分支1将全部由gitcheckout-bsub-branch1创建。来自feature1分支(从master分支出来)。例如:

git - 组织 git 分支

我有一个大型项目,我正在使用git作为VCS。在任何给定时间,我都在努力实现一些功能/错误修复等。对于任何给定的功能/错误,创建分支层次结构会很好——例如$gitbranchfeature1sub-branch1sub-branch2sub-branch3feature2sub-brancha*sub-branchb#是否可以这样做,还是我需要采用更原始的命名方案?编辑为了使我正在寻找的内容更具体一些,如果feature1是一个git分支,那么在上面的示例中,子分支1将全部由gitcheckout-bsub-branch1创建。来自feature1分支(从master分支出来)。例如: