git: --fast-version-control

Updating git

webi git@stable

Cheat Sheet

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Github's Git 'Hello World' is a good place to get started if you're new to git.

How to commit files

git add ./path/to/file1
git add ./path/to/file2
git commit -m "my summary for this commit"

How to ignore common files

In your project repository create a .gitignore file with patterns of fies to ignore


How to create a branch

This will branch from the branch you're currently on.

git checkout -b my-branch-name

How to rebase by default

git config --global pull.rebase true

How to rebase

To "rebase" simply means to undo any of your changes, apply updates from another branch first, and then replay your changes.

Rebase when fetching new updates

git pull --rebase origin master

Rebase a feature branch from master before a merge

# update master
git fetch
git checkout master
git pull

# go back to your feature branch
git checkout my-feature

# start the rebase
git rebase master

# fix conflicts if you need to, and then continue
git add ./my-merged-file
git rebase --continue

How to authenticate git with deploy tokens

Abbreviated from The Vanilla DevOps Git Credentials & Private Packages Cheatsheet:

First, update .gitconfig to handle each type of git URL (git, ssh, and http) as https:

git config --global url."".insteadOf ""
git config --global url."".insteadOf "ssh://"
git config --global url."".insteadOf ""

Next, create a .git-askpass:

echo 'echo $MY_GIT_TOKEN' > $HOME/.git-askpass
chmod +x $HOME/.git-askpass

Finally, add the following ENVs to your deployment environment:


# Relpace xxxx... with your deploy token

In the case of Github it may be useful to create a read-only deploy user for your organization.

This can work with Docker, Github, Gitlab, Gitea, CircleCI, and many more.


Report an Issue Submit Installer