Skip to content

Instantly share code, notes, and snippets.

@ArtemioVegas
Created March 4, 2019 09:03
Show Gist options
  • Save ArtemioVegas/b0553096294e1a02f3de11687220859c to your computer and use it in GitHub Desktop.
Save ArtemioVegas/b0553096294e1a02f3de11687220859c to your computer and use it in GitHub Desktop.
git usefull comands
--- Создает коммит который отменяет изменения указанного коммита, аттрибут m требуется если это мердж коммит - указать какого родителя (первый, второй и тд)
git revert <commit_hash> -m 1
--- удаляет последний коммит, если он еще не запушен
git reset --hard HEAD~1
--- сливает ветки, но не коммитит
git merge --no-commit merge_branch
git merge --no-commit --no-ff merge_branch
git commit -a -m 'Merge Branch CS-322 Manully'
--- изменение текста последнего коммита
git commit --amend -m "Merge Branch 'CS-332' in manual mode"
git revert 7a2842b -m 1
--- показать HEAD
git rev-parse HEAD
git rev-parse --short HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment