-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Using Git And GitHub
Jukka Lehtosalo edited this page Mar 30, 2016
·
4 revisions
If you are just starting mypy development or contribute only occasionally, or if the second workflow below feels too complicated, you can follow this simple workflow:
- Set up Git on your computer instruction
- Create a GitHub account, if you don't have one.
- Navigate to https://www.github.com/python/mypy and "fork" the repository. This gives you a clone of the repo hosted at GitHub under your GitHub account.
- Clone a local copy of your own fork of the repository. This creates a directory
mypy
under the current working directory. For example:
$ git clone https://github.com/<your-account>/mypy.git
- Do any commits in the local clone of the repo (any git tutorial explains this).
- Push changes to the clone of the repo hosted under your GitHub account:
$ git push
- Create an issue for your commit (if it doesn't exist yet).
- Post the URL of your hosted git repo clone as a comment related to the issue.
- Mentioning the commit ids (use
git log
or the GitHub repo browser to browse them) may help locate your changes. - Even better, perform all your commits in a branch, and mention the URL of the branch. No commit ids needed. See the git resources below for the details.
- The mypy developers will review and merge your changes to the main repo if your pull request looks good. This often takes several days or even longer during vacations, etc.
Here is a suggested git workflow for contributing code changes:
- Set up Git on your computer (https://help.github.com/articles/set-up-git).
- Create a GitHub account (unless you already have one).
- Navigate to https://www.github.com/python/mypy and "fork" the repository. This gives you a clone of the repo hosted at GitHub under your GitHub account.
- Clone a local copy of your own fork of the repository. This creates a directory {{{mypy}}} under the current working directory. For example:
$ git clone https://github.com/<your-account>/mypy.git
- Change the directory to the original cloned repo (mypy):
$ cd mypy
-
Create a new branch in the local mypy repo for your changes (replace with a descriptive but short name):
$ git checkout -b
* Now commit some changes to your local copy of the repository.
* Test your changes a bit and fix any bugs you find.
* Push the changes to the repo hosted under your GitHub account:
$ git push -u origin
* Send a pull request according to these instructions:
https://help.github.com/articles/creating-a-pull-request
* Now the mypy developers will review and merge your changes. This may take a few days (or more), depending on how busy the developers are.
* You probably want to check out the master branch again before continuing from step 5 for another contribution:
$ git checkout master
## More information
The above description did not mention some important things such as how to fetch and merge changes from the main mypy repo. Read this for more information:
* https://help.github.com/articles/fork-a-repo
Git tutorials for svn users:
* https://git.wiki.kernel.org/index.php/GitSvnCrashCourse
General git information:
* [Pro Git (online book)](http://git-scm.com/book)
* [Introduction to git at GitHub](http://learn.github.com/p/intro.html)
More about branching in git (it's not like in Subversion):
* http://learn.github.com/p/branching.html
* http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging
Using hg to access git repositories (not verified; please edit this and add a comment if you try this):
* http://hg-git.github.com/
* http://mercurial.selenic.com/wiki/HgGit