Jump to content

Please dispell my confuse. Git commands


Recommended Posts

Ok, I 'm a bit confuse now.
When in doubt, read the manual :). "git help branch", "git help pull". As you can see from those, the "git branch" command doesn't switch to the mangos012 local branch that you made. Use the form of the checkout command from the 303 announcement which not only creates a new branch, but also switches to it, and make it a "tracking branch". You don't need to use the SHA of the commit when it's the same as a branch name (like origin/mangos-0.12).
Link to comment
Share on other sites

  • 38 years later...

Ok, I 'm a bit confuse now.

Let's say I'm going to add ahbot on top of mangos-0.12 branch.

I should do:

git branch mangos012 8edbff

//This is the mangos-0.12 rev6948 hash

//now, apply ahbot

git pull git://github.com/Paradox/mangos.git master

//Hmm, at this moment, I got 2 conflicts errors. I'm thinking to use previous commit of ahbot to resolve it, but i 'm not sure about which hash, also, I'm confused what git commands to use to apply it into my created branch. Any help would be appreciated.

I also wonder, "git pull" command syntax suppose to be "git pull remoteURL branchLOCAL" ?? I tried "

git pull git://github.com/Paradox/mangos.git mangos012

", why it give "Couldnt find remote ref" errors???

I'm sorry if my question sounds stupid, I was making slow progress in git skill. Pls give me some input.

Link to comment
Share on other sites

Thank you! I figured it out.

Now I added another remote for ahbot.

git remote add ahbot git://github.com/Paradox/mangos.git

git reset --hard origin/mangos-0.12

git pull ahbot master

I got 2 conflicts coz ahbot 's master is developed for mangos master previously known as 303, :( Any idea how to compare and merge the file manually? I tried to use git diff , and read git diff help, and still in doubt, Guess I have to wait ahbot for their 0.12 branch launch.

Link to comment
Share on other sites

Thank you! I figured it out.

Now I added another remote for ahbot.

git remote add ahbot git://github.com/Paradox/mangos.git

git reset --hard origin/mangos-0.12

git pull ahbot master

I got 2 conflicts coz ahbot 's master is developed for mangos master previously known as 303, :( Any idea how to compare and merge the file manually? I tried to use git diff , and read git diff help, and still in doubt, Guess I have to wait ahbot for their 0.12 branch launch.

You wanted to see some older commits in ahbot branch (I guess to get some inspiration), you can use remotename/ahbot~0 for the topmost commit, remotename/ahbot~1 for the second commit from the top, remotename/ahbot~2 for third, etc.

git log -1 -p remotename/ahbot~5

git log remotename/ahbot

Link to comment
Share on other sites

You wanted to see some older commits in ahbot branch (I guess to get some inspiration), you can use remotename/ahbot~0 for the topmost commit, remotename/ahbot~1 for the second commit from the top, remotename/ahbot~2 for third, etc.

git log -1 -p remotename/ahbot~5

git log remotename/ahbot

Cool, that's very helpful info. Thank you!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use