-
Notifications
You must be signed in to change notification settings - Fork 107
Quick Git Howto
The following is a summary of the common commands when using git
The first thing to do is a Fork of the project to create yourself a repository of GeoExt2
Then Send a SSH public key to GitHub to be able to share your code.
git clone [email protected]:juliensam/geoext2.git
This creates a origin server
To be able to import the changes from the main GeoExt2 repository run the following:
git remote add upstream [email protected]:geoext/geoext2.git
The result will should look like the following :
$ git remote -v
origin [email protected]:juliensam/geoext2.git (fetch)
origin [email protected]:juliensam/geoext2.git (push)
upstream [email protected]:geoext/geoext2.git (fetch)
upstream [email protected]:geoext/geoext2.git (push)
The first thing to do is create a branch in which you will work. Never work in your master branch. In this example we'll call it b
git branch b
git checkout b
The following command will show you all your branches. The star (*) shows you the active branch.
$ git branch
master
* b
Once you have some changes you can add the files to you changes with :
git add <file>
Once all the the files are added you can commit all of them with:
git commit -m "Message"
Finally the following will send your changes to your github repository. Once there you can do a pull request to get your changes in the main GeoExt2 repository.
git push origin b
This will only fetch (not merge) the changes from the server.
git fetch upstream
To merge your changes, simply do this:
git merge upstream/master
or
git rebase upstream/master
See the doc to learn the difference.