Discard all local changes
Restore modified tracked files and remove untracked files:
git checkout .
git clean -f
Undo the last commit
Remove the last commit but keep its changes staged:
git reset --soft HEAD~1
Sync a fork with the main repository
git remote add upstream REPO_URL
git remote -v
git fetch upstream
git merge upstream/master
git push
Store credentials in GNOME Keyring (Fedora)
git config --global credential.helper /usr/libexec/git-core/git-credential-libsecret
Source: gnome-keyring-git-credential-fedora
Branching model for a project with client installations
Features are developed on branches from devel, merged back into devel, and devel is merged into master, which gets a tag for the main version:
devel : feature > devel > master : tag (main version)
Hotfixes are made on master, tagged as a minor version and merged back into devel:
master : hotfix
> master : tag (minor version)
> devel
- Clients’ release candidate (RC) installations run on
devel. - Clients’ production installations run on
master:tag.
Based on A successful Git branching model.
