Skip to content

Latest commit

 

History

History
126 lines (101 loc) · 4.04 KB

README.md

File metadata and controls

126 lines (101 loc) · 4.04 KB

practice-py

Build Status

Shared repository for python and pop-gen practice

Installation and configuration

  1. Install Homebrew

  2. Install git and pyenv via Homebrew: brew install git pyenv

  3. Add pyenv init to your shell config file (.bash_profile or .zshenv):

    if which pyenv >/dev/null; then eval "$(pyenv init -)"; fi
  4. 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
  5. Install and configure Atom

    % brew cask install atom
    % exec $SHELL -l
    % conda install flake8
    % apm install linter linter-flake8 file-icons
  6. Setup ~/.gitconfig and SSH key for your GitHub account to do git push without entering password

  7. Fork this repository to your GitHub account. Press "Fork" button at top-right of this page.

  8. 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
  9. 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.

Usage

  1. See tasks/issues in "To Do" column of Projects page.

  2. Synchronize your master branch with upstream/master:

    % git checkout master
    % git status
    % git fetch --all
    % git merge upstream/master
    % git status
    % git push  # origin master
  3. 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.

  4. Edit your local files.

  5. 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.

  6. Check upstream again, merge it to your master, 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
  7. 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.

  8. Send "Pull Request" from your GitHub page (Kazuki526, hamazaki1990). Check commit log and diffs before submission. Comments and questions are welcomed.

  9. You can commit and push again to your branch if you want to fix something.

  10. 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.

  11. 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