Skip to content

Example repository running Actions https://github.com/actions/toolkit/actions

Example workflow file: https://github.com/actions/toolkit/blob/master/.github/workflows/

GitHub stuff:

git remote update


Check if pull needed in Git
git status -uno
git show-branch *master

Github

force pull from master

git fetch --all
git reset --hard origin/master

delete all commit history in github:

# Checkout
git checkout --orphan latest_branch

# Add all the files and commit them
git add -A
git commit

# Delete the master branch
git branch -D master

# Rename the current branch to master
git branch -m master

# Finally, force update your repository
git push -f origin master

# remove the old files
git gc --aggressive --prune=all

# set tracking information
git branch --set-upstream-to=origin/master master

Git config stuff

git config --global user.name "username"
git config --global user.email "email"
git config --global color.ui "auto"

git clone a wiki page https://gist.github.com/subfuzion/0d3f19c4f780a7d75ba2 Clone a github wiki

See file as of a given commit: https://stackoverflow.com/questions/338436/how-can-i-view-an-old-version-of-a-file-with-git

git show REVISION:path/to/file

# Replace REVISION with your actual revision (could be a Git commit SHA, a tag name, a branch name, a relative commit name, or any other way of identifying a commit in Git)