Ok, so I have gotten myself completely confused here. I am not sure why I can’t seem to grasp some of GITs setup but I am just not cutting it! Please someone help me out. I have read tons of tutorials and nothing seems to fit what I want so it just confuses me.
Here is what I want to do but cannot get it right.
There is an open source project on github that has a branch (development) that I would like to grab to improve on, then at a later time publish to my own server. This repository is private read only which I have access to. I tried cloneing the project then making shcnages but I don’t know where to put them. Plus when changes come in from the github project, I still don’t get how to grab updates properly from the github dev branch (or even master branch when it gets that far) and not overwrite my own stuff.
Part of the confusion is that the project is using http://nvie.com/posts/a-successful-git-branching-model/ git-flow model which is throwing me off even more.
I am trying to use http://www.git-tower.com/ for managing GIT.
Could some compassionate soul help me by giving me a step by step for this particular instance?
I’ll try to do this step by step and you can ask questions so that I can expand on the answer.
Make a clone of the repository on github on your local machine.
This is done using the
git clonecommand. Something likegit clone -b development git://github.com/nibrahim/Xenon-Retroblast.gitshould do it. The url here will be read only since you won’t have write access to the original repository. I’ve used one of my own projects here as an example.This will create a local clone inside the
Xenon-Retroblastdirectory. The clone will by default point to themasterbranch but the-bparameter you gave while cloning it should take care of that.Now, make your changes locally and commit them.
Let’s say your own server hamman.com and you set up a repository over there. You can add that as a
remotein your local clone using the following commandgit remote add myown ssh john@hamman.com:~/repos/project.git. This is your private repository which you can mess with as you please. The local name of this repository ismyown. If you’re agithubuser, this remote can be a repository on github. You can also click “fork this project” on github and create a fork directly on the website, clone from that and add the official repository as a remote.To push your commits to this repository, you have to say
git push myown development(push the current branch to the ‘development’ branch on the remote ‘myown’). To fetch from the github repository, saygit pull origin development.I’m sure that the answer is incomplete but ask questions and I can flesh it out for you hopefully.