Chapter 21 Git commands
A collection of some of the Git commands that have been largely going on under the hood. We’ve emphasized early workflows that are possible in RStudio. But all of this and much more can be done from the command line. This list is here mostly so we can consult it during live workshops if needed.
Unless you use the GitHub API, most of the GitHub bits really have to be done from the browser.
New local git repo from a repo on GitHub:
Check the remote was cloned successfully:
Stage local changes, commit:
Check on the state of the Git world:
Add a remote to existing local repo:
Push local master to GitHub master and have local master track master on GitHub:
Pull commits from GitHub:
Pull commits and don’t let it put you in a merge conflict pickle:
Switch to a branch
Checking remote and branch tracking