1 2 |
// return to previous branch git checkout - |
1 2 3 |
interactive learning https://learngitbranching.js.org/?locale=ru_RU https://githowto.com/ru |
Git. Rev-Parse. Getting latest commit
Making commits history clean in the branch
1 2 3 4 5 6 7 8 9 10 11 |
# Reset the current branch to the commit just before the last 12: git reset --hard HEAD~12 # HEAD@{1} is where the branch was just before the previous command. # This command sets the state of the index to be as it would just # after a merge from that commit: git merge --squash HEAD@{1} # Commit those squashed changes. The commit message will be helpfully # prepopulated with the commit messages of all the squashed commits: git commit |
or
1 2 |
git reset --soft HEAD~3 && git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})" |
or
1 2 |
git reset --soft HEAD~3 && git commit |
cloning from remote
1 2 |
cd C:\C#\ScoreLib git clone https://github.com/KoHHeKT/ScoreLib.git |
git commit
1 2 3 |
git status git commit -m "Improve data model prototype" git push |
if added some files to local repository and need to sync with server
1 2 3 4 5 |
Summary: git add -A stages All git add . stages new and modified, without deleted git add -u stages modified and deleted, without new |
update local repository from master
1 |
git pull origin master |
1 |
git config credential.helper store |
Как вернуться к более раннему коммиту? Stackoverflow
Как удалить последний коммит, если мы сейчас стоим на нём (источник) ?
1 2 |
git reset --hard HEAD~1 |
Как удалить коммит с удаленного сервера?
1 2 |
git reset --hard last_working_commit_id git push --force |
Delphi IDE Git Client