-
Notifications
You must be signed in to change notification settings - Fork 364
Home
Step by step instructions that will guide you through the code contribution process. We will be using ataiya
as an example GitHub username here, as it will allow us to show some "live" examples of pull requests.
Further information is also available here.
Sign the Contributor License Agreement.
Fork the tensorflow_graphics repository on GitHub
~/: git clone https://github.com/ataiya/graphics.git ~/tfg
~/: cd ~/tfg
Note you can use SSH authentication as well.
You will want to keep your fork up-to-date with the main codebase.
To do so, we will add an official
remote:
~/tfg: git remote add official https://github.com/tensorflow/graphics.git
You can inspect the remotes you will be using:
~/tfg: git remote -v
official https://github.com/tensorflow/graphics.git (fetch)
official https://github.com/tensorflow/graphics.git (push)
origin https://github.com/ataiya/graphics.git (fetch)
origin https://github.com/ataiya/graphics.git (push)
If you are planning to make multiple isolated contributions, it is a good idea to use different branches, one per contributions you plan to perform. You can do so via git commands:
~/tfg: git checkout -b contribution1
Switched to a new branch 'contribution1'
~/tfg: git push -u origin contribution1
Branch 'contribution1' set up to track remote branch 'contribution1' from 'origin'.
~/tfg: git branch
* contribution1
master
The published branch is now visible https://github.com/ataiya/graphics/tree/contribution1.
You could omit git push -u
if you only wanted local branch, but we will need it to be public to be able to create a pull request.
You will want to update your branch often with the (master branch of the) official repo to minimize the chance of conflicts, or at least make them easier/faster to resolve:
~/tfg: git pull official master
* branch master -> FETCH_HEAD
Already up to date.
As we just forked the official repository, our branch is already up to date.
WARNING: this will erase any local changes
~/tfg: git fetch official
~/tfg: git reset --hard official master
HEAD is now at 0593f0d [...]
~/tfg: echo "Simple test change" >> simple_test_change.txt
~/tfg: git add simple_test_change.txt
~/tfg: git commit -m "A simple test change"
~/tfg: git push
And now our simple "A simple test change" is visible on the public fork: https://github.com/ataiya/graphics/commit/cdb1eae62febf7850871aa5efd466165d03fcdf4
We can now visit the branches
page of your fork
https://github.com/ataiya/graphics/branches
and press New pull request:
Make sure to choose a good name for your PR (pull request) and fill out a description of your work.
Also ensure you are creating a PR against base repository: tensorflow/graphics
and base: master
.
Submit feedback about the wiki by replying to this issue.