Download 🡥
Getting Started Installing Git 🡥
git config --global user.name "Thiago Honorato"
git config --global user.email [email protected]
ls -al ~/.ssh
ssh-keygen -t ed25519 -C "[email protected]"
Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
git config --global core.editor code
git config --global --edit
git init
git add <path|file_name>
git commit -m "message"
git branch -M <branch_name>
git remote add origin <repository>
git push -u origin <branch_name>
git remote add origin <repository>
git branch -M <branch_name>
git push -u origin <branch_name>
git clone -b <branch_name> <repository>
git pull origin <branch_name>
git add <path|file_name>
git commit -m "message"
git push origin <branch_name>
git checkout -b <branch_name>
git branch -m <old_branch> <new_branch>
git branch -M "<new_branch>" (other way)
git checkout <branch_main>
git merge <branch_with_feature>
Apply change from one branch to another.
git switch <branch_with_change>
git log
// copy commit id
git switch <branch_destiny>
git cherry-pick <commit_id>
git push origin <branch_destiny>
git reset --hard <commit_id>
git push -f origin <branch_name>
git branch <branch_name> -d
git push origin -d <branch_name>
git branch | grep -v "^\*" | xargs git branch -D
git branch -l
git log
git log --pretty=oneline (other way)
Run the following command to amend (change) the message of the latest commit:
git commit --amend -m "New commit message."
List all variables set in config file, along with their values.
git config --list
To show the actual path where this setting is applied
git config --list --show-origin
git config --system core.longpaths true