Git
A version control system. Maybe not the best in all aspects, but the most popular. Sane people use git clients like Sublime Merge or Magit.
Basic commands
Other stuff
# Git config
To view config: git config --list
Don’t forget to set a local timezone: git config --global log.date local
UPD: not sure if it works! And not sure if it’s even needed.
# .gitignore
If you commit some file and then decide to not track it and add it to .gitignore
, it still will be tracked. Tracked files are never ignored, see
git - File is not ignored despite adding it to .gitignore.
As for a separate .gitignore
for each branch, It’s kinda complicated. See
this gist and this
SO question.
# Patches
I still don’t quite understand how they work. They contain commit hashes, so they should only be applicable on the same repo, but I was somehow able to apply it to a repo with wiped out commit history.
Tip: to generate a patch from a commit on github, just add .patch
to the commit URL.
# Commit info structure
Example:
|
|
Use git cat-file commit <some-commit>
to view it. Yes, there is an author, and a committer. See more
here. And
here’s how to change committer and author.
# Submodules
|
|