r/coding • • Sep 17 '19

Git - A dead simple tutorial for beginners

https://www.coderomeos.org/getting-started-with-git-a-dead-simple-tutorial-for-beginners
301 Upvotes

10 comments sorted by

26

u/MyWayWithWords Sep 18 '19

That's the thing with Git, it's actually pretty simple to just Add and Commit some files. It's the only thing you do 90% of the time.

It's just when you start Merging, and Rebase, Check out, Revert, Reset, Patch, etc, it's far to easy for your repo to explode into a huge unrecoverable mess.

I've been using Git for just over 10 years, and I still get nervous when I need to do an advance/normal every day command.

7

u/gtmkmr Sep 18 '19

True. Once I messed up my local repository and have to reclone everything. 😅

9

u/exDM69 Sep 18 '19

Almost everything in git is non-destructive. For "undo", see git reflog to see what changes you've made and you can checkout the appropriate version with the commit hash.

15

u/robin-m Sep 18 '19

I highly advice you toeread http://tom.preston-werner.com/2009/05/19/the-git-parable.html It explains how git works internally, and once you understand that, everything become easy.

3

u/Xavier_OM Sep 18 '19

I find git quite simple to use with a good GUI like GitExtensions or SourceTree, even for 'advanced' usage like rebasing branches or subtree or else you don't need the console at all.

2

u/gtmkmr Sep 19 '19

Never used Git GUI.. but seems good idea when messed up.