Git
A time machine for code: every change saved, by whom and why.
Git is a program that records the history of a folder of files. Each time you save a set of changes you make a commit: a snapshot with a message ("fix login bug"), an author and a date. You can go back to any snapshot, compare two of them, or see who changed a given line and when. Linus Torvalds wrote it in 2005 to manage the Linux kernel, and today it is used for almost all software.
Its second trick is branches. A branch is a parallel line of history: you open one to try a new feature, commit freely without touching the main version, and when it works you merge it back. Several people can work on different branches of the same project at once, and Git combines the results, flagging the rare lines where two people changed the same thing (a "conflict").
Git itself works on your machine. GitHub, GitLab and Bitbucket are websites that host a copy of the repository so a team can share it: git push sends your commits there and git pull brings down everyone else's. A pull request on GitHub is a proposal to merge a branch, with a review conversation attached. Most open source software lives this way.
Keep in mind
- A commit is a snapshot plus a message; the history is a chain of them.
- Branches let several people work in parallel; merging joins the work.
- Git is the tool; GitHub is one place to host the repository.
clone,commit,push,pullandmergeare the five commands you will hear most.