I have a project on github and I just committed and pushed it. However, my changes don't show up on github.
I think I didn't have the master
branch checked out. Which means I don't know the name of the branch I'm currently working in. Honestly, I don't really know where I just committed my changes.
How can I find out which branch I currently have checked out? How can merge these changes into master
? What did I just do?
When I committed, it said:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Not currently on any branch.
And then I did a git push
, and I have no clue where that was pushed to.
$ git log
commit dcb85bcfafa18d9dfe9f12659e7ba0e2662ca45e
Author: ...
Date: Wed May 18 22:41:57 2011 -0400
Fix for new vm website layout, add CREDITS
Where is my code? How can I merge it into master?
The git checkout command lets you navigate between the branches created by git branch . Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch.
git branch
git branch --contains dcb85b
gitk --all --date-order
To merge it into master, you could git merge dcb85b
or git cherry-pick dcb85b
or one of any number of commands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With