Jump to content

[guide] howto fork mangos and commit


Guest balrok

Recommended Posts

i want to give a short guide how to set up an own fork with an own branch (for patchwriters or developers)

i'm no expert in git, i just explain how i did it, there are surely better ways for this, so please read comments to the thread if someone know better ways or hints)

also i just have linux, but i think for windows this should be quite the same

first create a github-account and provide your ssh-key to them..

if you don't have ssh-keys already (mostly found in ~/.ssh/*.pub)

you need to run "ssh-keygen" and then the pub-key is in "~/.ssh/id_rsa.pub (or dsa if you specified it)

then go to http://github.com/mangos/mangos/tree/master and press the "fork" button

you now should be in "http://github.com/YOUR-NAME/mangos/tree/master"

and, if you are on this page, you should see

public clone url: git://github.com/YOUR-NAME/mangos.git

your clone url: [email protected]:YOUR-NAME/mangos.git

the "public clone url" is just for simple cloning (like the public in mangos/mangos)

"your clone url" is for cloning and pushing (so if you want to make changes to your fork, you need this url (or if you allowed someone else to commit to your fork he also needs to checkout from there)

---

side note:

if you haven't set your name+email do it now:

$ git config --global user.name "My Name"
$ git config --global user.email [email][email protected][/email]"

it's good for anybody who has questions to you, if you don't set this you only will be listed as "unknown" (which is a cool nickname, but confuses others)

/end sidenote

---

git clone yourclone_url source
cd source
git remote add upstream   git://github.com/mangos/mangos.git
//update mangos:
git pull upstream master
//create own branch
git checkout -b 
//edit something, commit something
echo "muh" >> THANKS
git commit -a
//now push it to your internet-space
//origin, cause you cloned it from there
git push origin test //dont forget the branch-name

--> finished

if it needs much time for devs to review your patch or you just want to update it:

cd source
git checkout master
git pull upstream master
git checkout Your_branch
git merge master
//if problems occur
git mergetool
git commit -a
//endif
git push origin Your_branch

If you do want to delete the remote branch you can use: "git push origin :branch_to_delete".

notes:

please read freghars post about commitmessages

in short:

specify a commit-header containing 50 chars (if you don't know how to summarize to 50 chars you surely need to commit more often) followed by 2 newlines and then you can describe your changes by as much text as you want (i have seen a linux-kernel commit where the comment was 50 lines and the code changed were just 3 lines^^)

push when you think you're ready, mostly there is no need to be fast.. cause if you want to change something already commited later, it will be bad for everyone who checked out your branch cause the sha-hashes won't fit anymore

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