简体   繁体   中英

Git branching/tag/version basics

I guess I still don't get git as I'd hoped...

I was creating a new branch, then going back, and I'm back farther than I intended. So I need to come forward to where I was Monday or so.

If I use the Git Gui "Visualize all branch history" tool, I can see all my versions, and I think where I want to be. So first question: how do I show that here? Git可视化截图

Then I'll just need to know the proper way to move forward to Monday's commit.

Thanks,

ed

The answer to this was to use Git Gui only very carefully. And to got to git log in the command line to really see what is happening.

The commits I wanted ended up being left only in an unexpected branch, and it took a number of selective merges to get them back.

Moral of the story:

1) Make sure everything is committed somewhere. You can always delete it from the repo, but not recover it if Git (with your help) drops uncommitted working directory files.

2) TortoiseGit and GitGui are nice tools. But make sure you learned the basics in the command line before you do a git reset -hard

:-)

If I understand this correctly, you created a branch of master but from a past point. (please correct me if this is not what you mean). Then all you have to do is merge the extra commits that were done after , to do that:

git checkout <yourbranch>
git merge master

or 


git merge <commit>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM