Articles

Git: everyday commands and a simple branching model

· 1 min readgitsoftdevel

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

Based on A successful Git branching model.

All articles

See also

softdevelPL

Notuj swobodnie, niech AI zadba o resztę

Od zawsze, im więcej notowałem, tym mniej użyteczny stawał się mój notes, czy to papierowy, czy elektroniczny.

linuxsoftdevel

Linux server administration: a practical cheatsheet

Security checks, certificates, scheduled jobs, disks and backups, network diagnostics and basic system configuration — commands I use on Linux servers.

ovhlinuxsoftdevel

OVH Public Cloud: moving instances, adding disks and swapping the gateway

Moving virtual servers with the OpenStack client, attaching a new block storage disk, and replacing the private network gateway when the public IP is blacklisted.