Joyce Robbins 12/7/18
Note: This is an attempt to outline beginner workflows in as succinct a manner as possible for reviewers who are familiar with Git/GitHub and can provide feedback / suggest improvements to the workflows themselves, rather than the how-to. As such, I have not provided step-by-step, tutorial style instructions. Eventually the ideas here will all be incorporated into a tutorial presentation, a draft of which is available here: GitHubWorkflow.pdf.
Feedback welcome by issue, pull request, or email: jtr13@columbia.edu
Thank you for your help!
Beginner workflows in increasing order of difficulty:
Situation: You have files that you want to share.
Mantra: WORK, UPLOAD, REPEAT
Method:
- Create a repo on GitHub.
- Add files on GitHub via the "Add files via upload" button.
Situation: You are the only contributor to your project. You need to be able to work locally and sync with GitHub.
Mantra: PULL, WORK, COMMIT, PUSH, REPEAT
Method:
- Create a repo on GitHub.
- Clone it while creating a new RStudio project.
- Begin with pulling, then work, commit, push. Everything is done with RStudio buttons.
Situation: You are working on a project with other collaborators that resides on your GitHub repo. You have agreed that pull requests will not be merged by the author.
Mantra: PULL, BRANCH, WORK, COMMIT, PUSH, SUBMIT PULL REQUEST, DELETE BRANCH, REPEAT
Method:
- Same as above but work starts with a new branch (RStudio button)
- After pushing new work, a pull request is submitted on GitHub.
- Once the PR is merged, the remote branch is deleted on GitHub (button) and locally with
git branch -d <branch-name>. Stop tracking deleted branch withgit fetch -p.
to be added
to be added
Notes on fixing things
Undo saved, uncommmitted changes:
git checkout -- <file-name>
(discards changes in working directory)
Undo saved, committed changes:
https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-commits-in-git/34547846