r/learnpython • • Sep 22 '20

What is learning GIT?

I saw in a post that you have to learn git for most programming jobs, what exactly is git? and where can i learn it, i always just assumed its just uploading your stuff to github. not too sure if this is the right place to post this

347 Upvotes

116 comments sorted by

View all comments

1

u/chmod--777 Sep 23 '20

I'd generalize git as a system that helps you track a series of changes to files in general, most helpful for text file changes. That results in coders being able to track changes to code, merge them, and save results of a specific set of changes that are applied, allowing you to track a version as a series of specific changes.

Like think of a bank account. Instead of tracking the sum, track it as an initial stage of zero, them I deposit $200 in cash, then I pay off my internet with $50, then pay off my car insurance with $125. I gave $25 left as a result of that series of changes.

But taking it farther, I could save the point in time where I deposited two hundred and track that as Account V1. And someone else could have that and make a separate timeline where they deposit another $300, and then freeze that as Account V2. In account V2 it has two deposits as the series of changes and $500 as the result. That is a separate timeline, where they made their modifications. Then they could merge that into my "branch" or timeline, and the result is $325, the applied changes from both of our activity.

Git is used like that for code, people handling the code in different timelines or "branches" then freezing versions at specific points and merging other people's changes. It tracks different timelines and changesets. That's essentially what git is made for, which makes it really easy to see every single action and change that was ever applied which led to a program's code existing at a certain state.