cleguen - Git Cheat Sheet

Git Cheat Sheet


Here is a list of git command that I think are useful and not necessarily known.

I will skip git init, git push, git commit, etc.

To change the name of the branch master:

git branch -M main

to rename branch from master to main

To add updates to the last commit:

git add .

git commit --amend --no-edit

git push -f

with --no-edit can skip the name update of the last commit. You can keep it to change it.:

Change the URL of the git project:

git remote set-url origin <url>

replace <url> with the new project path


Corentin Le Guen © 2024 - All Rights Reserved.