Shared repository for python and pop-gen practice
-
Install Homebrew
-
Install git and pyenv via Homebrew:
brew install git pyenv
-
Add
pyenv init
to your shell config file (.bash_profile
or.zshenv
):if which pyenv >/dev/null; then eval "$(pyenv init -)"; fi
-
Install Anaconda via pyenv:
% exec $SHELL -l % pyenv install --list | less % pyenv install anaconda3-4.3.1 % pyenv versions % pyenv global anaconda3-4.3.1
-
Install and configure Atom
% brew cask install atom % exec $SHELL -l % conda install flake8 % apm install linter linter-flake8 file-icons
-
Setup
~/.gitconfig
and SSH key for your GitHub account to dogit push
without entering password -
Fork this repository to your GitHub account. Press "Fork" button at top-right of this page.
-
Clone the forked repository to your local machine:
% mkdir ~/git % cd ~/git % git clone https://github.com/{YOURNAME}/practice-py.git % cd practice-py/ % atom . % python hello.py
-
Make an alias to
upstream
repository:% git remote add upstream https://github.com/heavywatal/practice-py.git % git remote -v origin https://github.com/{YOURNAME}/practice-py.git (fetch) origin [email protected]:{YOURNAME}/practice-py.git (push) upstream https://github.com/heavywatal/practice-py.git (fetch) upstream [email protected]:heavywatal/practice-py.git (push)
Note that your forked repository is named
origin
.
-
See tasks/issues in "To Do" column of Projects page.
-
Synchronize your
master
branch withupstream/master
:% git checkout master % git status % git fetch --all % git merge upstream/master % git status % git push # origin master
-
Make a new branch from
master
for each task, and switch to it:% git checkout -b issue-2-individual % git status
Do not commit to
master
or old branches. -
Edit your local files.
-
Commit the change to the task branch:
% git status % git diff % git add main.py % git status % git commit -m "Create Individual class #2" % git status
Please include the issue tag in your comment.
-
Check
upstream
again, merge it to yourmaster
, and rebase the task branch if necessary:% git fetch upstream ##### if any updates are available % git checkout master % git merge upstream/master % git status % git checkout issue-2-individual % git rebase -i master
-
Push the commit to your
origin
:% git push origin issue-2-individual
You may need to rename the branch or
push --force
to solve a conflict. -
Send "Pull Request" from your GitHub page (Kazuki526, hamazaki1990). Check commit log and diffs before submission. Comments and questions are welcomed.
-
You can commit and push again to your branch if you want to fix something.
-
The PR will be corrected and merged to heavywatal/practice-py. You can go back to the step 1 to move on to the next task before the PR merging.
-
After PR merging, the task branch can be deleted by pushing a button on the PR page or by pushing an empty branch with
git push origin :issue-2-individual