Git Commands
1 min read
The following are those CLI commands from Git that I tend to forget specially after long periods without using them, so in order to avoid that uncomfortable feeling of not remember them when I need to implement something quickly I’ll put every single one here to find them easily.
Add a fresh local repo to a remote one:
git initgit remote add origin git@gitlab.com:rootpass/myRepository.gitgit push -u origin mainCreate, select and upstream to remote a new branch:
git branch myBranchgit select myBranchgit push -u origin myBranchDelete local and remote branches:
git branch -d myBranchgit push origin -delete myBranchCreate tag (annotated or lightweight):
git tag -a myTag -m 'V1.0'git tag myTagUpstream tag (one tag or several tags):
git push origin myTaggit push origin -tagsDelete local or remote tag:
git tag -d myTaggit push origin -delete myTag