These notes are based on Patrick O'Leary's video that he kindly created when I was wingeing about problems with git. It is best to watch the video first then go back through these notes to recall the steps.
Create a clone of the JuliaLang repository
git clone git://github.com/JuliaLang/julia.gitor
git clone git://github.com/JuliaLang/julia.git myjuliaChange directory to the newly created clone
cd juliaand check the remote status
git remote -vAfter creating a fork of the julia repository under your own github account, add the repository
git remote add mine [email protected]:dmbates/julia.gitand check again
git remote -vCheck the available branches
git branchwhich should be just the master branch.
To make a new patch, create a new branch
git checkout -b linalg_testwhich will also switch to the new branch, as you can check with
git branchor
git statusNow edit or add the file(s) you wish to change (in my case test/lapack.jl) then check that indeed the file has been edited.
git statusor
git diff(This can also be accomplished within emacs by running M-x git-status in this directory.)
At this stage I prefer to operate in the *git-status* buffer to add and commit the change to the local clone. The shell version is
git add test/lapack.jl
git commit You can check the log at this point
git logor, better
git lgusing the alias available at (http://www.jukie.net/bart/blog/pimping-out-git-log).
To create a pull request the change must first be pushed to the user's github repository.
git push mine HEADwhich should respond with something like
To [email protected]:dmbates/julia.git
* [new branch] HEAD -> linalg_test
Checking on github.com should show the newly created branch with the change. Select the branch and click the Changes button to verify this.
Before creating a pull request, ensure that your branch is up to date
git checkout master
git lg
git pullthen switch back to the modified branch, rebase it, check the log and push to mine if required.
git checkout linalg_test
git rebase master
git lg
git push mine HEAD
As a new contributor, I encountered a few issues using the instructions above. These might seem terribly obvious to some users, but they were confusing for me.
First, the instructions above only describe how to set up a user's system and how to push a change into the user's own repository. They do not explain how to create a pull request itself. To create a pull request, see https://help.github.com/articles/using-pull-requests. Also, just to clarify, a pull-request is not a concept native to Git itself. Pull requests are a mechanism provided by GitHub to notify an approver/maintainer about a change the user has pushed and would like to have added to the main project repository.
In the following command, be careful to substitute your github name for dmbates in
git remote add mine [email protected]:dmbates/julia.gitThe link for the enhanced git-log http://www.jukie.net/bart/blog/pimping-out-git-log times out for me me, for it seems to be available at https://gist.github.com/mathiasverraes/4505589. The process seems to work fine using plain git-log, however.