Ed Jones
Ed Jones

Reputation: 653

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 visualization screenshot

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

Thanks,

ed

Upvotes: 2

Views: 156

Answers (2)

Ed Jones
Ed Jones

Reputation: 653

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

:-)

Upvotes: 1

Wissam Youssef
Wissam Youssef

Reputation: 830

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>

Upvotes: 0

Related Questions