Tipy i inne rzeczy
Aliases for common git commands in ohmyzsh docs
git restore --source NAZWA_BRANCHA -- PATH_DO_PLIKU
np.
git restore --source experiment -- app.js
Nie pisz za każdym razem
git branch --set-upstream remote/...
git config --global push.default current
Commiter - osoba zapisana w ustaawieniach (globalnych lub dla danego repozytorium)
git config user.name "user name"
git config user.email "[email protected]"
Author - domyślnie brane z commitera, może być nadpisane używająć --author
git commit -a -m "some changes" --author "Mr. Random <[email protected]>"
Wtedy commiter będzie [email protected]
, a author [email protected]
.
You may be wondering what the difference is between author and committer. The author is the person who originally wrote the patch, whereas the committer is the person who last applied the patch. So, if you send in a patch to a project and one of the core members applies the patch, both of you get credit — you as the author and the core member as the committer.
Czyli jest to dla repo, które używają maili do dodawania commitów (np. kernel linuxa)