Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or am I missing something?

That you can create arbitrary branches and keep them forever remotely or locally. If you think you'll need it branch off that point: git checkout -b branch_i_may_need then checkout the previous branch. a git log branch_i_may_need will always show the commit you needed at the top and git cherry-pick `git rev-parse branch_i_may_need` will cherry pick it into whatever branch you're on. That way you keep the commit and can still keep the remote repo clean.



You can also avoid doing the two git checkouts by just doing "git branch branch_i_may_need" and you'll stay in your current one. I do that all the time, though i had no clue about git rev-parse. That's a great time saver.


FYI, since (at least, IIRC) 1.7.2 that rev-parse is not necessary. You can even do `git cherry-pick ..branch_i_may_need` for multiple commits.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: