Suppose you are using a computer, like you are doing right now. You probably use it most of the time to browse the web, but you also use it to create content. Suppose you are working on an essay, for example. Have you ever been in a situation where you were creating that essay, and you thought, ‘I wish I could just go back to how this essay was before today?’ No? How about that one time where you accidentally deleted all the files on your flash drive… Interested now? Git and its remote service, Github allow you to solve these problems in an extremely elegant fashion, by keeping track of versions whenever you tell it to. This has helped programmers around the world to collaborate on projects, independent of how well they know the developer!
Git is a very complicated but useful piece of software, and fully understanding it can take years of experience. However, this does not stop one from using it productively! To get started on windows, you can install git from here. Here are some terms important for you to learn, ones that you will be using every day when using git:
- Commit- In its simplest form, it is a version. When you want to save a version for future reference, or for backup. This can be as simple as a single addition or a large feature set (in a program). If you get confused, read commit as ‘change’
- Repository- Where the things you want to version control are. It is usually a folder on your computer. When you make a commit, files from this folder will be added to the repository, and will be kept version controlled. In git, every computer involved has its OWN FULL copy of the repository. To make changes, you commit then distribute them to other members.
- Push- A push is where you move commits from one copy of a git repository to another copy (usually on different computers).
- Pull- A pull is where you get new commits from another repository, to update your copy.
- Branch- This is a slightly advanced concept that describes a point where commits diverge. Suppose you make a commit (change). Then you reset your computer to before you made that commit, and make a different commit. The paths have diverged between these two commits, they are on different branches. Its ok if you dont understand this, I will talk about it more later!
- Rebase- A more advanced concept that I will talk about later. (It requires you to know about branches).
Also, keep in mind, git works best with pure text files (like code files). It works, but extremely inefficiently on other types of files. Next week, we will start with creating your first git repository, making a commit, and saving your code (or text) up on github!
– [onion] chesse