modify message of last unpushed commit
git commit --amend -m "New commit message"
create tag:
git tag -a MY_VERSION -m „my version 1.0-Release“
git push origin [tagname]
git tag - show all tags
git show MY_VERSION
change repository for pushes
git remote set-url origin ssh://<git@.../new_repository.git>
git push -u origin master
create new local branch
git checkout -b <branchName>
create new remote branch
1. create local branch
git checkout -b <branchName>
2. push local branch. origin = <remote>
git push origin <branchName>
3. set tracking information for this branch you can d
git branch --set-upstream-to=origin/<branchName> <branchName>
delete files and folders from repository but not from file system
git rm -r --cached target/*
delete .orig files
git clean -f
make visible new remote branch local
git pull
merge my branch with other branch
git merge <other_branch> --no-ff
--no-ff - create a merge commit even when the merge resolves as a fast-forward
merge conflicts
git mergetool
remove new local branch
git branch -d <branchName>
remove new local branch immediately
git branch -D <branchName>
revert added files
git reset HEAD <file>
show all branches (remote and local)
git branch -a
show local branches
git branch
show remote branches
git branch -r