Incomplete list of frequently used GitHub commands
Make new branch
git checkout -b branchName
Switch branches
git checkout branchName
Clean up branches
Delete local branches git branch -d <branch>
In the RStudio list (remote branches I deleted still show)
git fetch -p
then click the drop down arrow on the refresh circle and click Refresh Now`
Change default branch name from master
to main
:
https://stevenmortimer.com/5-steps-to-change-github-default-branch-from-master-to-main/
What’s my remote URL?
git remote -v
Changing the remote repository url
git remote set-url origin <paste url>
Note that origin
is the nickname you give the remote
If you see mistakes or want to suggest changes, please create an issue on the source repository.