Skip to content

Modifying an existing project

Alex Forrence edited this page May 2, 2016 · 4 revisions

How to take an existing project, make changes, and submit those as a pull request. (This is subject to change -- I'm still hashing out the "right" way to do it) (This also assumes everyone has read/write access to the remote repo, which may not be true in the future)

  1. Assuming you're already in the correct directory, check out a new branch locally with git branch <branch_name>.
  2. Use git checkout <branch_name> to switch to the new branch.
  3. Same git add, git commit as on master. If you want to push the branch remotely (to Github), use git push -u origin <branch_name>.
  4. To locally merge the branch, switch to master and do git merge <branch_name>, then push to Github. 4.2. To remotely merge the branch, push the branch and follow the Github instructions on pull requests.
  5. To delete the local branch, git branch -d <branch_name>. To delete the remote branch, get on Github and do it from the branches page, eg (https://github.com/BLAM-Lab-Projects/github-notes/branches).

Addendum. Switch back to the master branch with git checkout master.

Addendum. Keep up to date with master with git rebase master (if branch is local only), or git merge master (if branch is also remote).

http://stackoverflow.com/questions/5691557/how-can-i-keep-my-branch-up-to-date-with-master-with-git

http://stackoverflow.com/questions/3329943/git-branch-fork-fetch-merge-rebase-and-clone-what-are-the-differences

Clone this wiki locally