This is an old revision of the document!
Wyświetla zmiany dotyczące podanego pliku
git log -p filename
Wyświetla zmiany, które wysłane zostaną na serwer po wykonaniu commita
git diff --cached
INFO: http://stackoverflow.com/questions/1587846/how-do-i-show-the-changes-which-have-been-staged
Tworzy paczkę
git archive --format=tar --prefix=tomatocart/ master | gzip > tomatocart_msp_module-02-jan-2012.tar.gz
Modyfikuje całą historię gita
Razu jednego, przez przypadek wysłałem zmianę zawierającą hasło w jednym z plików. Oto jak usunąłem niebezpieczną linię ze wszystkich commitów. UŻYWAĆ Z ROZWAGĄ!!!
git filter-branch --tree-filter 'sed -i "" "/bind_password/d" lib/ddrive/application.rb' HEAD
INFO: http://git-scm.com/book/ch6-4.html#The-Nuclear-Option:-filter-branch
Korzystanie z innych gałęzi sklonowanego repozytorium
Gdy sklonujemy zdalne repozytorium, git branch -a wyświetli nam wszystkie gałęzie. Aby pracować na takiej gałęzi należy utworzyć lokalną gałąź powiązaną ze zdalną.
git checkout -b experimental origin/experimental
INFO: http://stackoverflow.com/questions/67699/how-do-i-clone-all-remote-branches-with-git
Tworzenie zdalnych gałęzi
git push <remote-name> <local-branch-name>:<remote-branch-name>
INFO: http://stackoverflow.com/questions/1519006/git-how-to-create-remote-branch
Tworzenie gałęzi ze wcześniejszego //commita//
git branch branchname <sha1-of-commit> git branch branchname HEAD~3
INFO: http://stackoverflow.com/questions/2816715/branch-from-a-previous-commit-using-git
Łączenie dwóch commitów w jeden
git rebase --interactive HEAD~2
INFO: http://stackoverflow.com/questions/2563632/how-can-i-merge-two-commits-into-one
Usuwanie nieśledzonych plików i katalogów
git clean -f -d
INFO: http://stackoverflow.com/questions/61212/removing-untracked-files-from-your-git-working-copy
Wysyłanie lokalnej gałęzi
git push -u origin bug/asap-527
Search through all the history for a string
git log -G player_password -p
List all files modified in a branch
git diff --name-only feature/core-player-limits $(git merge-base feature/core-player-limits production)
List recent branches
git branch --sort=-committerdate
