moloxe.io / blog / useful-git-commands
Add changes
Undo last commit keeping changes
Undo last commit without keeping changes
Show changes
Show commit history
Show current branch
Show remote repository
Create branch
Clone remote branch
Get last version of master
Show all branches
Delete local branch
Force delete local branch
Delete remote branch
Move to master
Push to master branch in an existing repository
Pull from another branch
Merge with another branch
Disclaimer: sería bueno que verifiques cómo funcionan los comandos antes de ejecutarlos, chatgpt es una buena opción btw.
git add *
git commit -m "description"
git push
git reset --soft HEAD~1
git reset --hard HEAD~1
git status
git log
git branch
git remote -v
git checkout -b "some_branch"
git checkout --track origin/some_branch
git pull origin master
git branch -a
git branch -d "some_branch"
git branch -D "some_branch"
git push origin --delete "branch"
git checkout master
git pull
git remote add origin https://url.git
git push -u origin master
git pull origin "some-branch"
git merge "some-branch"