[英]Git Switch/Checkout to this
I got myself in a mess and was wondering if you could help? 我陷入混乱,想知道您是否可以帮忙? There is probably a lot to it, so I was hoping to get the jist of what I need to do.
可能有很多事情,所以我希望了解我需要做的事情。
This is what I think I need to do: 这是我想做的:
Maybe I am wrong, but I don't think I have to create a branch every time I switch to a certain checkout. 也许我错了,但是我不认为每次切换到特定结帐时都必须创建一个分支。 All I want to do is verify the version compiles, then go back to where I left off.
我要做的就是验证版本是否可以编译,然后回到我停下来的地方。
PS I am trying to accomplish this with Windows GIT (if you couldn't tell). 附言:我正在尝试使用Windows GIT完成此操作(如果您不知道)。 I can get the jist of the Unix commands.
我可以得到Unix命令的精髓。
PSS If it isn't too much to ask, I was also thinking of making version 07 version 11. Get rid of the versions that don't compile, instead of making another "Working Branch". PSS如果要求不高,我也正在考虑制作07版的11版。摆脱那些无法编译的版本,而不是制作另一个“工作分支”。 What would be the correct way to do something like that.
做这样的事情的正确方法是什么? Extra thanks.
额外的感谢。
Thank you, 谢谢,
The trouble with checking out an earlier revision on its own is that it leaves your repo in “headless” mode. 自行检出较早版本的麻烦在于,它使您的存储库处于“无头”模式。 Unlike Subversion, Git doesn't remember which revision you are on if it isn't the tip of a branch.
与Subversion不同,如果它不是分支的顶端,那么Git不会记住您所使用的版本。
To properly keep track of things, you need to create a temporary branch at that earlier revision, eg: 为了正确跟踪事物,您需要在该早期版本中创建一个临时分支,例如:
git checkout -b temp_branch older_commit
This is easy to do, and you can always delete the branch later — remember that “ git-branch -d
” will only delete “fully-merged” branches, which such a temporary branch will be, so such a deletion will be quite safe. 这很容易做到,您以后可以随时删除该分支-请记住,“
git-branch -d
”将仅删除“完全合并”的分支,这样的临时分支将是这样,因此这样的删除将非常安全。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.