Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.62 KB

git.md

File metadata and controls

54 lines (37 loc) · 1.62 KB

GIT

Tipy i inne rzeczy

Cheat sheet

ohmyzsh aliases

Aliases for common git commands in ohmyzsh docs

Weź jeden plik z innego brancha

git restore --source NAZWA_BRANCHA -- PATH_DO_PLIKU

np.

git restore --source experiment -- app.js

Auto upstream

Nie pisz za każdym razem git branch --set-upstream remote/...

git config --global push.default current

Commiter vs Author

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)

Source