Parts of this presentation are based on these slides by Dr. Mine Çetinkaya-Rundel.
git init
git stage -A
git commit -m "short yet informative message of changes made in this commit"
GitHub is the home for your Git-based projects on the internet – like DropBox but much, much better
We will use GitHub as a platform for web hosting and collaboration (and as our course management system!)
In this class, you will, for the most part, be working alone in GitHub repos that you own (option 2 from previous slide).
After making sure your local git is connected to a GitHub repository through git clone
:
git push
git pull
For that, we will follow the New project, GitHub first workflow (see link above for detailed instructions).
Every single new coding exercise will follow the above workflow, in a way that you will have one git/GitHub repo in your own GitHub for each exercise.
The workflows delineated above that include stage, commit, push, and pull are very simple.
git/GitHub can handle a lot more complex workflows including branching, forking, pull requests, etc.
For now, we will focus on the simple workflow above, and will explore more complex workflows as needed.
Commit often (multiple times a day), push less often (few times a day)
Before pushing, always pull first!
There is a great resource for working with git and R: happygitwithr.com.
We’ll make extensive use of this resource, please get acquainted.
git pull
to start your work fresh with most recent version from remote
git status
to check the status of git
git stage -A
to stage changes
git commit -m "commitMessage"
to make a commit
git push
to send changes from local to remote
git log --oneline
to see summarized list of commits (push q
to quit console when done)