[./home]

Fri, 18 Nov 2022 16:39:55 +01:00

Git cheat sheet

Git for daily use.
Updated as needed.

Clean merge process

git checkout test
git pull 
git checkout master
git pull
git merge --no-ff --no-commit test

Cancel a merge with conflicts

git merge --abort

Tagging

create the tag

git tag -a MY_TAG -m "something" -m "another line"

OR

git tag -a MY_TAG -F <comment_file>

push the tag

git push origin --tags

OR

git push origin  MY_TAG

Remove Tag

Local tag first

git tag -d <tagname>

An then remote tag

git push --delete origin <tagname>

Branching

git checkout -b <my_branch>

Undo git add

git reset <file>

Amend a commit

git add history.txt
git commit --amend --no-edit
git push --force