Author Topic: How to setup a fork on github for develop  (Read 2976 times)

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
How to setup a fork on github for develop
« on: 23 July 2014, 19:52:32 »
I really have problems to manage git. Because I would like to develop simple features like the HP-Bar i died i would like to set up myself a fork to develop.
The problem is that i dont understand how?  :confused: Maybe i have a completely wrong understanding of git.

FreshD helped me, but i dont think its working porperly.

So could you please give me a step by step instruction how to set it up and answer to the following questions:
1. Should i better have 2 folders on my pc? One for the original mg-repo and one for mine?
2. How can i setup this remote stuff?
2.1 How do i update my branches in my fork repo? Or shouldnt I?
2.2 Which steps do i need to take to update/to get the newest version?
Code: [Select]
git checkout upstream/develop
git pull
?
2.3 Maybe you could even explain me the stuff with the remotes because i dont get it in any way yet :(
3. How can i let a branch be based on the the newest develop branch from the mg-repo and how can i push it to my repo? Or is creating new branches in my repo the wrong way to do it?
4. When i write git push on a branch which is not in my "online"-repo it will be created right?
5. How do i switch the branches correctly? With git checkout branchname?

OR

Tell me another way to set up something to develop.

Its really sad that i dont get the idea of git, because git is the only thing that prevents me from developing for mg (ok i am a newbie in c++ but i can implement simple features). The last week i really tried to make some things, but most of the time was wasted into understanding git. I think i wasted about 5 hours or more into understanding git and this is definitely to much for a version control system.  >:(
Is it really this hard to contribute to mg???

EDIT: I got it working now and i think i got it but a small instruction to look up if i did everything right would be nice!
« Last Edit: 23 July 2014, 20:27:07 by titi_son »
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

FreshDumbledore

  • Guard
  • ***
  • Posts: 61
    • View Profile
Re: How to setup a fork on github for develop
« Reply #1 on: 23 July 2014, 20:26:34 »
Well, as i just destroyed my local clone (at least i thought so, actually i think now it was fine and i just cause an error myself lol) and re-did it (in less than 2 minutes :P) here is exactly what i did:

$ rm -rf megaglest-source/
$ git clone https://github.com/FreshDumbledore/megaglest-source // clone your own fork-rep
$ cd megaglest-source/
$ git pull // can be ignored, just to show we got all data with the clone command
Already up-to-date.
$ git remote add upstream https://github.com/MegaGlest/megaglest-source // add the official mg repo as your upstream to fetch from
$ git fetch upstream // fetch from the original repo (not your clone) to be up to date with it
$ git checkout develop // can be ignored we were already on develop
Already on 'develop'
$ git pull
Already up-to-date.

What is, by the way, exactly what the instruction i linked you tells to https://help.github.com/articles/fork-a-repo

mine is working again :-P

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: How to setup a fork on github for develop
« Reply #2 on: 23 July 2014, 20:29:22 »
And now the develop branch has upstream/develop as base and origin/develop as target?
Or do i need to update my local develop branch somehow?
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

FreshDumbledore

  • Guard
  • ***
  • Posts: 61
    • View Profile
Re: How to setup a fork on github for develop
« Reply #3 on: 23 July 2014, 20:38:37 »
one more thing i needed to do:
[branch "develop"]
        remote = upstream
        merge = refs/heads/develop

adjusted the remote name in the .git/config
theres a better way to do that but i know this one and it works :D

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: How to setup a fork on github for develop
« Reply #4 on: 25 July 2014, 04:38:09 »
theres a better way to do that but i know this one and it works :D
git push -u origin develop. If I recall correctly, if you try and push without setting the remote branch to push to, you should get a message that details the command to use(this one).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything