Basics
semantic versioning
https://semver.org/
clone
-
git clone <url>clone an arbitrary repository
add
-
git add .add all files to stage
commit
-
git commit -m "some commit message"commit staged changes with inline commit message
commit in (new) branch
-
git stash push -
git checkout -b <branch_name> -
git stash pop
branches
-
git checkout <branch-name>checkout the branch with given name -
git checkout -b <branch-name>create and checkout a new branch with given name
remotes
-
git push -
git fetch -
git pull
rename branch
-
git checkout <old_name> -
git branch -m <new_name> -
git push origin -u <new_name> -
git push origin --delete <old_name>
store credentials
- in plaintext in
~/.git-credentials-
git config --global credential.helper store
-
- in cache
-
git config credential.helper 'cache --timeout=<timeout>' - timeout in seconds (default 900 sec)
-
gitlab personal access token
- go to
https://gitlab.com/-/profile/personal_access_tokens- rights:
read_repositoryandwrite_repository - add line in
~/.git-credentials:https://private-token:{{token}}@gitlab.com
- rights:

