Size: 4520
Comment: comment about not using master for PRs
|
Size: 4632
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 30: | Line 30: |
''git remote add upstream `git@github.com:wxWidgets/Phoenix.git`'' | For HTTPS ''git remote add upstream `https://github.com/wxWidgets/Phoenix.git`'' or SSH ''git remote add upstream `[YOUR_USERNMAE]@github.com:wxWidgets/Phoenix.git`'' |
How to contribute using GIT
The wxPython code is stored in a Github repository and the preferred way of providing changes is via PR's (Pull Requests), the following page will provide some pointers on how to work with git and Github.
The first thing you should do is create a a free Github account and fork wxWidgets Phoenix repository (see top right of screen), see also Fork a repo. Then to get this code to your local PC you need to clone the fork you did, see also Git basics.
Create a pull request
A PR can be a simple one line change or a new widget or anything in between this. A pull request can be commented on and often the comment will mean changes to a PR before it will be merged, therefore it is strongly suggested to create a branch in your clone of the repo for each PR.
Following are the steps using the git cli and assumes you have ssh setup. I personally do this all in the UI client I use, until today that was Tortoise for GIT but Robin just mentioned SourceTree, which I have to say is much nicer and handles both git and hg repositories.
cd yourphoenixclonedir
git checkout master - switch to the master branch, if you just cloned then you already have the master branch checked out
git status - allows you to check on which branch you are
git checkout -b yourbranchname - create a new branch called 'yourbranchname' and switch to it. Do not skip this step. Submitting your master branch as a PR can sometimes have problems if master is updated before your PR is reviewed.
make changes and git commit -a -m 'add your first change' - do this frequently
git push
- create the PR on your github account from 'yourgitaccount:yourbranchname' to 'wxWidgets:master'
- getting comments to the PR
- make changes and commit frequently
git push the PR will be updated automatically
Resync your fork with Robin's master
After Robin has merged your change or done other changes to the master branch you need to get this into your fork.
Your fork is normally referred to as 'origin' and the wxWidgets repository is normally referred to as 'upstream' although you can use a different name for the remote repository if you wish.
You need to add the wxWidgets repo as upstream.
For HTTPS
git remote add upstream https://github.com/wxWidgets/Phoenix.git
or SSH
git remote add upstream [YOUR_USERNMAE]@github.com:wxWidgets/Phoenix.git
Get the changes from upstream and push them to your fork.
git fetch upstream
git checkout master
git rebase upstream/master
git push
A few links to tutorials and other useful help to get going with git.
Git immersion tutorial -- This looks pretty comprehensive, just replace 'Ruby' with 'Python':)
Fork a repo -- This is what gave Robin the "Ah ha!" moment when trying to grok github.
Graphical tools for GIT
Until today I used Tortoise for GIT and TortoiseHG, but had to check out Robin's favoured and find SourceTree very nice and it does handle both Github and Bitbucket repo's in one UI - neat:).
On Windows
SourceTree -- What Robin uses when he isn't using Git from the CLI.
Tortoise for GIT - a graphical UI
On MAC
SourceTree -- What Robin uses when he isn't using Git from the CLI.
On Linux
"$@#!@! There's no SourceTree for Linux!" -- Robin
SmartGitHG -- It's not as smooth as SourceTree, but it is what Robin uses when he just can't figure out the CLI. Ironically, it's a NOT FREE tool that he only uses on a FREE operating system.