Jump to content

Grabbing different branches


Guest Poe

Recommended Posts

I know how to get the master from MaNGOS via GIT, but I would like to access the "mangos-0.12" branch, and I don't know how. The only way I've found to successfully download the master branch is to "git clone git://github.com/mangos/mangos.git" followed by where I want the files put, then after that just right-click the folder they're in, and "git bash here" followed by "git pull"

Since all the branches are in "git://github.com/mangos/mangos.git" how do I specify a branch, since it assumes master if I don't? I've read through the guides, and I haven't found the command, and I can't get any syntax or command usage info from the GIT bash window. I'd prefer to learn to use the bash window, rather than install an unneeded GUI.

halp?

Link to comment
Share on other sites

[mangos@box:~/source] $ git clone git://github.com/mangos/mangos.git

*snip*

[mangos@box:~/source] $ cd mangos

[mangos@box:~/source/mangos] $ git checkout -b 243 origin/mangos-0.12

git checkout: updating paths is incompatible with switching branches/forcing

Did you intend to checkout 'origin/mangos-0.12' which can not be resolved as commit?

Any take on this?

Is by any chance this the same?

git checkout -f mangos-0.12

Link to comment
Share on other sites

git checkout -b 243 origin/mangos-0.12

Did that, got this:

 
$ git checkout -b 243 origin/mangos-0.12
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/mangos-0.12' which can not be resolved as commit?

Link to comment
Share on other sites

Did that, got this:

 
$ git checkout -b 243 origin/mangos-0.12
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/mangos-0.12' which can not be resolved as commit?

Try

git branch 243 --track origin/mangos-0.12
git checkout 243

This should work for Git version 1.4.x and lower (or at least I used it this way then).

Link to comment
Share on other sites

Did that, got this:

 
$ git checkout -b 243 origin/mangos-0.12
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/mangos-0.12' which can not be resolved as commit?

the same problem here

can you solve :confused:

Link to comment
Share on other sites

Please take your time and read this short thread before posting any useless posts, thanks.

Excuse mine ignorant, but I have git 1.4.4.4 and do not have possibility update him.

And after googling and read some info's I slill don't solve problem

how to update origin/mangos-0.12

Link to comment
Share on other sites

i've done it minute ago O_o

git clone git://github.com/mangos/mangos.git <local dir name to create>

cd <created dir path>

git checkout -b <local branch name to create> origin/mangos-0.12

and works perfect, now applying patches xD

Okay, I'll try that.

Link to comment
Share on other sites

Hi,

So I am also interested in using only the mangos-0.12 branch and am having difficulties understanding all the data I am reading from so many posts in so many different places.

From what I understood in the announcements section and in some of the guides in the stickies in the sourcecode mastery section, in order to get the sourcecode you must:

- install git latest version (check)

- set up git on the code repository, wich I did like this:

git clone git://github.com/mangos/mangos.git c:/MangosSrv/Sources/MangosGIT/

This worked fine and then I could update fine with git pull and everything. But the thing is I am only interested in branch 0.12 wich I was made to understand that will be kept alive as further support for client version 2.4.3.

Is there any way to just grab that part and not everything from the beginning? Because right now I am using OwnMCore6354_SD507_ACID18_UDB358 and I would like to keep at it without stepping into 3.0.3 territory and frankly even if after the two commands from above if I go

git checkout --tracking - b 2.4.3_stable origin/mangos-0.12

I am pursuing this because I am confused of what happens after I grab everything - I am not sure how to compile only the part I am interested in.

To reformulate - what happens after the operations:

- git clone, then switch to branch mangos-0.12?

the compile process remains the same or does it change in order to keep compiling server versions for client 2.4.3?

Link to comment
Share on other sites

Hi,

So I am also interested in using only the mangos-0.12 branch and am having difficulties understanding all the data I am reading from so many posts in so many different places.

From what I understood in the announcements section and in some of the guides in the stickies in the sourcecode mastery section,

Hello, so you already searched around a bit? Good, you passed my personal IQ test!

I am pursuing this because I am confused of what happens after I grab everything - I am not sure how to compile only the part I am interested in.

Doesn't make sense for me, perhaps you should describe what you mean in another way.

To reformulate - what happens after the operations:

- git clone, then switch to branch mangos-0.12?

the compile process remains the same or does it change in order to keep compiling server versions for client 2.4.3?

"git clone some_remote_url local_dir"

1) git clone initializes a new local git repository in local_dir/.git/ and download all the object files (in a pack) to local_dir/.git/objects/ directory

2) then it creates ("checkouts") the working tree (= all the files you normally see, README, src/, sql/, ...) outside the .git/ dir (ie. to local_dir/), using the object files (which stores, in fact, almost everything in the repo)

"git checkout --track -b my_branch origin/mangos-0.12"

1) it creates the my_branch branch (= a 41-byte txt file in .git/heads/my_branch), using the topmost commit from origin/mangos-0.12 remote branch

2) then it sets the tracking (see my "Chapter 2" for more about it) in .git/config

3) finally, it checkouts the whole working tree from my_branch, nothing 303-related left in there

Thanks to that tracking, you can use "git pull" from inside the my_branch to fetch + merge new changes from mangos-0.12. If it prints an error like "failed to set tracking", then you have to use "git pull origin mangos-0.12" in there.

Also note that git clone downloads everything, ie. you already have origin/mangos-0.12 in your local repo when you clone.

And the compiling process should be the same as it used to be on 2.4.3.

footnote: I'm closing this topic, if anyone has a new error (check for typos in command before saying that), feel free to post it in another topic. I hope there won't be any "HOW TO GET 2.4.3????" topics anymore. They will get locked, because nobody can be so stupid, it has been answered about 16 times, only from what I've seen.

Link to comment
Share on other sites

×
×
  • 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