Trying to wrap my head around Git... one question...
#1
I've read the manual pages but I can't seem to understand this.

How on earth do I revert to a commit?

Say I wanted to take master and go back in time to a commit back in, say, early January (lets say b12d33d293). How would I backtrack and build the source up to that commit?

Thanks!
Reply
#2
git revert?
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
Reply
#3
Tried that. git revert b12d33d293. Doesn't seem to work. When building, it builds master and not what I want it to... Are there any other steps I must make?
Reply
#4
xgamer99 Wrote:Tried that. git revert b12d33d293. Doesn't seem to work. When building, it builds master and not what I want it to... Are there any other steps I must make?

try here: http://progit.org/book/ch2-4.html
-stoli-
Reply
#5
stoli Wrote:try here: http://progit.org/book/ch2-4.html

Still can't get it to work...

Why is it so hard to rollback to a previous commit? SVN made it very easy with update -r <revision>

I kinda got it to work with git reset --hard <commit>. However, after I do that I can't find a way to get back to the latest commit without git complaining about something... =/
Reply
#6
To go back to an old revision, git checkout b12d33d293 works fine for me.

git reset to delete some commits.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#7
just to summarise what the other said
xgamer99 Wrote:How on earth do I revert to a commit?
Code:
git revert b12d33d293

Quote:Say I wanted to take master and go back in time to a commit back in, say, early January (lets say b12d33d293). How would I backtrack and build the source up to that commit?
checkout the tree:
Code:
git checkout b12d33d293
if you want to do anything else than just building, do this after checking out:
Code:
git checkout -b newcoolbranch
that will create a new branch, branched off from commit b12d33d293
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#8
dushmaniac Wrote:checkout the tree:
Code:
git checkout b12d33d293
if you want to do anything else than just building, do this after checking out:
Code:
git checkout -b newcoolbranch
that will create a new branch, branched off from commit b12d33d293

This is also possible in one step by doing
Code:
git checkout [-b] newcoolbranch b12d33d293
The "-b" is optional and can be left out if you don't want to automatically switch to the new branch.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#9
dushmaniac Wrote:just to summarise what the other said
"How on earth do I revert to a commit?"
Code:
git revert b12d33d293

I don't think that's the same thing that I want. I think that just reverts the changes that single commit created, rather than rollback to a snapshot in time for that commit.

I will try git checkout and report back. =)

EDIT: Thanks everyone. checkout seems to be what I wanted. =)
Reply

Logout Mark Read Team Forum Stats Members Help
Trying to wrap my head around Git... one question...0