我想只把与 TortoiseGit 的最后一项承诺推到源代码 forge 仓库。 所有前一项承诺都不可推倒 。 < a href="https:// stackoverflow.com/q/1789017/1179158"。 这里 < a > 说我可以创建一个新的分支, 并推动这个分支。 但是新分支有所有前一项承诺, 而不仅仅是最后一项承诺 。
我做错什么了?
谢谢!
我想只把与 TortoiseGit 的最后一项承诺推到源代码 forge 仓库。 所有前一项承诺都不可推倒 。 < a href="https:// stackoverflow.com/q/1789017/1179158"。 这里 < a > 说我可以创建一个新的分支, 并推动这个分支。 但是新分支有所有前一项承诺, 而不仅仅是最后一项承诺 。
我做错什么了?
谢谢!
我认为这主要是对Git如何运作的误解。 当您推动一个承诺时, 如果该承诺有父/母, git 将会确保该父/母也在远程存储库中。 除了稀疏的克隆( 可用于保存带宽和/ 或磁盘的使用, 但对您如何与远程存储库互动施加一些限制 ), git 的设计是为了保持对象数据库的完整和一致性。 如果您可以推动一个承诺而不在存储库中, 完整性/ 一致性将会被违反 。 因此, 通过设计, 您可以在不确保承诺线条被保存的情况下, 直接推动一个单一的承诺 。
上面说,您可以安排只推动一个承诺,有两个具体的方法:1)确保您想要推动的承诺的母体已经在远程数据库中(例如,使用 rebase
将分支上的所有承诺都压到一个承诺上,必要时可以将分支迁移到一个承诺上,但可能不是您工作流程的最佳选择),或2)确保您想要推动的承诺没有父体,例如,最近版本的 git 中 < code> git check out - b somebranch -- orphan ,然后创建您的承诺。
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...