This repository was archived by the owner on Oct 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- Navigate to the directory of your choice through the Unix CLI. (e.g.
cd ~/Documentsto clone in your Documents folder) - 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 calledorigin. - Run
git remote -vto see remotes. If you see a fetch and push to origin, you're all set.
Once your local repository is all set up, we can begin workflow.
Before beginning work on a new feature or issue, make sure your forked master is up to date with the upstream master.
- Run
git checkout master && git pullto make sure your local master is up to date.
- 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-Nameorgit checkout -b bugfix/Bugfix-Name - Run
git statusto highlight untracked or unsaved changes in red and tell you what local branch you are on - Use
git addto add files you wish to track.- You can add a single file with
git add <filename> - Add everything with
git add *orgit add . - Discard changes on a file with
git checkout -- <filename>
- You can add a single file with
- When you are sure of your changes, run
git commit -m "Commit Message", with a brief summary of your changes - Synchronize your changes with the remote repository on GitHub by running
git push -u origin feature/Feature-Name.
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.
- Open a Pull Request using GitHub's UI to notify the maintainer of the repository that your branch is ready to be merged.
- Once the branch merged into the original repository's master branch, the local and remote branches can be deleted.
- If you need help with any of these, contact jpark3@scu.edu