Thursday 9 November 2023

Git cheatsheet

Tags

Create a taggit tag -a 1.0.0 -m "First release"
Delete a remote taggit push --delete main 1.0.0

Commits

Remove all commit history and set the code as the only commit
git checkout --orphan newBranch
git add -A  # Add all files and commit them
git commit
git branch -D master  # Deletes the master branch
git branch -m master  # Rename the current branch to master
git push -f origin master  # Force push master branch to github
git gc --aggressive --prune=all     # remove the old files


No comments:

Post a Comment