Please, follow these steps
1. Fork the repo to your own github account. click the Fork button to create your own repo copy under your GitHub account. Once forked, you're responsible for keeping your repo copy up-to-date with the upstream pytorch_cnn_trainer repo.
2. Download a copy of your remote username/pytorch_cnn_trainer repo to your local machine. This is the working directory where you will make changes:
$ git clone https://github.com/oke-aditya/pytorch_cnn_trainer.git
- Install the requirments. You many use miniconda or conda as well.
$ cd pytorch_cnn_trainer
$ pip install .
- Set the upstream to sync with this repo. This will keep you in sync with pytorch_cnn_trainer easily.
$ git remote add upstream https://github.com/oke-aditya/pytorch_cnn_trainer.git
- Updating your local repo: Pull the upstream (original) repo.
$ git checkout master
$ git pull upstream master
$ git checkout -b feature-name
$ git branch
master
* feature_name:
Edit files in your favorite editor, and format the code with black
# View changes
git status # See which files have changed
git diff # See changes within files
git add path/to/file.md
git commit -m "Your meaningful commit message for the change."
Add more commits, if necessary.
Preliminary step (done only once): Install gh by following the instructions in docs .
# Fill up the PR title and the body
gh pr create -B master -b "enter body of PR here" -t "enter title"
You can confirm that your PR has been created by running the following command, from the pytorch_cnn_trainer folder:
gh pr list
You can also check the status of your PR by running:
gh pr status
More detailed documentation can be found https://cli.github.com/manual/gh_pr.
If you want to change your code after a PR has been created, you can do it by sending more commits to the same remote branch. For example:
git commit -m "updated the feature"
git push origin <enter-branch-name-same-as-before>
It will automatically show up in the PR on the github page. If these are small changes they can be squashed together by the reviewer at the merge time and appear as a single commit in the repository.
Upload your local branch to your remote GitHub repo (github.com/username/pytorch_cnn_trainer)
git push
After the push completes, a message may display a URL to automatically submit a pull request to the upstream repo. If not, go to the pytorch_cnn_trainer main repo and GitHub will prompt you to create a pull request.
Ensure your pr is listed here
- Updating a PR:
Same as before, normally push changes to your branch and the PR will get automatically updated.
git commit -m "updated the feature"
git push origin <enter-branch-name-same-as-before>
Maintainers and other contributors will review your pull request. Please participate in the discussion and make the requested changes. When your pull request is approved, it will be merged into the upstream pytorch_cnn_trainer repo.
note
pytorch_cnn_trainer repository has CI checking. It will automatically check your code for build as well.