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

3

u/Astrokiwi Sep 22 '20

git lets you save and load your code, and tracks all your old saves. So if you screw up, you can go back to an old save. You can also have multiple versions of your code, "branching" from the same save. This means that different people can work on the code at the same time. It means you can mess around with adding new features without breaking anyone else's code, and with the safety net that you can always go back to an old save. You can also combine different saves, so if somebody has added a feature in one "branch" you can "merge" those together. This is still useful if you're working by yourself, because you can add features one at a time and test them independently, while still keeping a fully working copy of your code running.

github - and other websites like bitbucket - are not actually necessary, but they're useful. You can save your git "commits" anywhere you like. But github and bitbucket provide nice websites where you can save your commits, to share them with other people.

Without git (or other version control software), you can easily end up with multiple versions of the same code, even if you're coding by yourself. Without git, you have to manually backup your code every time you make major changes. Without git, it's much harder for multiple people to contribute to one codebase, because you have to manually copy the code around and make changes. This will often lead to mistakes, where people make changes to the wrong versions, which then need to be fixed.

git just makes coding safer and easier.