Skip to content
This repository was archived by the owner on Oct 2, 2020. It is now read-only.

Git Workflow

Junha Park edited this page Jan 27, 2020 · 2 revisions

If you don't have Git installed on your Unix CLI, refer here: https://github.com/park-junha/PlanForGrad/wiki/Install-Git

You will need to clone this repository to your local machine.

  1. Navigate to the directory of your choice through the Unix CLI. (e.g. cd ~/Documents to clone in your Documents folder)
  2. Clone the repository to your local machine by running git clone https://github.com/park-junha/PlanForGrad. Git will by default set a remote to the repository called origin.
  3. Run git remote -v to see remotes. If you see a fetch and push to origin, you're all set.

Workflow

Once your local repository is all set up, we can begin workflow.

Verify master is up to date

Before beginning work on a new feature or issue, make sure your forked master is up to date with the upstream master.

  1. Run git checkout master && git pull to make sure your local master is up to date.

Create a local branch

  1. Create a new local branch on your repository for each new issue, such as a feature or a bug fix: git checkout -b feature/Feature-Name or git checkout -b bugfix/Bugfix-Name
  2. Run git status to highlight untracked or unsaved changes in red and tell you what local branch you are on
  3. Use git add to add files you wish to track.
    • You can add a single file with git add <filename>
    • Add everything with git add * or git add .
    • Discard changes on a file with git checkout -- <filename>
  4. When you are sure of your changes, run git commit -m "Commit Message", with a brief summary of your changes
  5. Synchronize your changes with the remote repository on GitHub by running git push -u origin feature/Feature-Name.

Finalize changes

When you have finished your work on your local branch and are ready to have it merged to master, propose a Pull Request for the lead developer to see.

  1. Open a Pull Request using GitHub's UI to notify the maintainer of the repository that your branch is ready to be merged.
  2. Once the branch merged into the original repository's master branch, the local and remote branches can be deleted.

Questions

Clone this wiki locally