These are some basic instructions on creating your own fork of gallery3 on GitHub, making changes to it, keeping it up-to-date and getting your changes back into the master repository. These are the basic steps that you will have to take:
First of all you will need to install the git client software on your machine. See above for a description on how to do it on Windows.
If you don't already have one you will need to create an account on GitHub.
Once you are logged in you go the gallery3 master repo at [1] and click on the fork button at the top.
In order for you to be able to push changes to your fork repo you will need to provide GitHub with you puplic key. This authenticates you and makes sure you have the necessary permission to push to that repo.
You find a good explanation on GitHub on how to do that: [2]
In order to get a copy of the code onto your local machine you have to clone your fork repo. You will have to use 'Your Clone URL' instead of the 'Public Clone URL', because the later one is read-only. So what you will have to do is run:
$ git clone git@github.com:username/gallery3.git
This is where it becomes a little tricky. But this GitHub guide should help: [3]
To merge changes to the master repo back into your fork, first start up Git Bash and navigate to the directory your code is stored in.
See above for committing those updates back to your github account.
notes courtesy of talmdal - core developer
Here, we'll discuss these concepts of using git. What to do and when to do it.
I fork gallery/gallery3 so I can make changes to the gallery that may never be moved to the originating repository. I might have some unique changes that I want to make to my gallery installation, but don't think they will ever be integrated into the main gallery3 distribution.
I clone the remote repository to that I can have a local repository that I can edit and test against.
I branch a repository when I want to make changes that I expect to re-integrate with the original repository. The difference between fork and branch is intent and access. Fork when you don't have write access or may diverge; "branch" when you do have access and will likely re-merge the changes.
notes courtesy of talmdal - core developer
I want the following development environment. I have read/write access to all the gallery/* repro's being a core developer. A non core developer would only have Read access to the gallery/* repro's and write to their own fork.
On my development system the above respository structure looks like:
/var /git_data /gallery3 gallery/gallery3 (main) Read/Write Access gallery/gallery3:talmdal (branch) Read/Write Access talmdal/gallery3 (fork) Read/Write Access talmdal/gallery3: my_branch (branch) => Read/Write Access talmdal/gallery3 /gallery3-contrib contains: gallery/gallery3-contrib(main) Read/Write Access gallery/gallery3-contrib:talmdal(branch) Read/Write Access /gallery3-vendor gallery/gallery3-vendor(main) Read/Write Access /gallery3-packaging gallery/gallery3-packaging(main) Read/Write Access
/var/www/gallery3 is a symlink to /var/git_data/gallery3
I also symlink any -contrib modules from the web root i.e. from the /var/www/gallery3/modules directory ln -sf /var/git_data/gallery3-contrib/modules/developer developer Then in /var/git_data/.git/info/exclude add the line modules/developer This will allow the gallery3 module administration to find the developer module yet will force git to ignore it when it checks status and does commits.
git clone git://github.com/gallery/gallery3.git gallery3
cd gallery3 git remote add <remote name> <git-url> git fetch <remote name>
At this point, you should be able to to pull updates from the main gallery repository git pull origin master and push your changes to your repository git push <remote name> master
If you are using a git repository that you have write access to, you can create a branch to make the changes without changing the main trunk.
git config push.default tracking
git checkout -b <branch-name> origin/master
git push origin <branch-name>
git branch --track <new-branch> <remote name>/master
At this point, you should have 2 unique repositories:
git remote show
And multiple branches
git branch -l
This is my setup, but could be applied to your clone of the repository.
git clone <git-url> gallery3-contrib
cd gallery3-contrib git config push.default tracking
git checkout -b <branch-name> origin/master
git push origin <branch-name>