Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

Useful stuff for github and/or git

Happy git with R a bookdown site from Jenny Bryan. Particularly useful are

Learning git branching is a nice interactive tool for learning git

OH MY GIT! game for learning git

github markdown

Githubs flavour of markdown

Some commands

git clone path-to-your-forked-repo
git remote ctu path-to-ctu-main-repo

Merge upstream repo into your fork

git pull https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git BRANCH_NAME
git commit -i * -m 'merge with upstream master'

Ref:
https://help.github.com/en/articles/merging-an-upstream-repository-into-your-fork
https://stackoverflow.com/questions/5827944/git-error-on-commit-after-merge-fatal-cannot-do-a-partial-commit-during-a-mer

You can also define a remote...

# only necessary once
git remote REMOTE_NAME https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
# pull via
git pull REMOTE_NAME BRANCH_NAME

...which normally automatically merges and commits.

Push local branch to origin (i.e. github)

E.g. if you've created a branch while not being connected to the internet...

git push origin develop

Ref:
https://www.git-tower.com/learn/git/commands/git-push

Renaming a branch

Could be useful...

Ref:
https://www.hostinger.com/tutorials/how-to-rename-a-git-branch/

Delete a local branch

git branch -d BRANCHNAME

from here, which also shows how to delete a remote branch

Sync private/public repos

A repo cannot be simultaneously private and public, just one or the other. It is possible to use GH actions to sync content. The action can be found here. Note that you need to modify the repository path on line 23. The file may also need some cleaning up for spaces...