r/learnprogramming • • Feb 02 '18

If you have watched so many git tutorials and simply can't get it try this one.

I tried searching on the net and also reddit for best tutorials for learning github but was mostly redirected to the official docs or the udacity one which I coulnd't get the hang of . Until I found this by

Derek Banas (while learning thru his java playlist). https://www.youtube.com/watch?v=r63f51ce84A&list=PLGLfVvz_LVvQHO1PfyscjIPkNJjgHsLyH

Will hardly take your 2 hours. 4 videos and you will know everything it takes to know to get git. And what more he also has a cheat sheet for his tutorials which are kind of like class notes for brushing up if you need them. Example : http://www.newthinktank.com/2014/04/git-video-tutorial/

Please do checkout :). And last but not the least here is one very important feature of github which I think is not really highlighted( watch it after you have learnt github).

https://stackoverflow.com/questions/4114095/how-to-revert-git-repository-to-a-previous-commit Thanks

Woho! So many upvotes Git is an excellent thing which takes time to get around but once you are used to it there is no going back. Thank you so much for this. I hope this helps everyone who wants to git it :)

1.7k Upvotes

71 comments sorted by

24

u/[deleted] Feb 02 '18

Git add .
Git commit -m "commit message"
Git push origin master

Occasional "git pull" when it gets messed up.

Thats all you need :)

1

u/[deleted] Feb 02 '18

And a git init before add

1

u/steezpak Feb 02 '18

And the adding remote.

7

u/themiro Feb 02 '18

honestly..

3

u/[deleted] Feb 02 '18

Not gonna lie, I thought I knew git with just thoe commands...this post makes me wonder if I'm actually a noob for not understanding what's difficult about it...like there's even a desktop app if you want to be lazy (and personally I don't think you gain anything from knowing the command line anyway in terms of productivity.)

8

u/[deleted] Feb 02 '18

I think these commands are sufficient when you're working on a project by yourself. If you're working on an application with 10+ other people, it will get way more intense.

Git seems easy until you start running into merge errors lol

1

u/[deleted] Feb 02 '18

Yeah mostly worked solo or in a group of two or four. In terms of merge errors though I guess the first time I encountered it was actually a guided tutorial where we were forced to create a few from multiple sources and resolve it

4

u/theadammorganshow Feb 02 '18

/sarcasm?

5

u/[deleted] Feb 02 '18

No lol I've been using git for 2-3 years now, mostly just for personal projects. I've never used it within like a software team or anything so these are pretty much the only commands I ever need to run.

Every once in awhile I'll get some nasty conflicts that I have to figure out via SO but that doesn't happen too much.

18

u/Starcast Feb 02 '18

That is fine, but you are simply using git as a backup, not a distributed version control system which is what it is.

Learn Git Branching is a great way to introduce yourself to the power of branches at the very least. They can be tremendous help even if you aren't collaborating on a repo, but still working on multiple different changes simultaneously.

1

u/[deleted] Feb 04 '18

This is amazing! Thanks for sharing!

11

u/steezpak Feb 02 '18

You should really learn branching workflows. That way you can isolate features you're working on.

2

u/theadammorganshow Feb 03 '18

Yeah if you're just doing personal projects that makes more sense then.

1

u/DatabaseDev Feb 03 '18

Only commands i ever use

3

u/AbheekG Feb 02 '18

Great, thank you so much for posting this!

2

u/[deleted] Feb 02 '18

Welcome

140

u/regexpressyourself Feb 02 '18

Shameless self promotion here, but I made a git tutorial that bends to your workflow as you go though it. Would love if you checked it out too:

Git Flow

91

u/Ingeloakastimizilian Feb 02 '18

In the starting a new git project branch, you say "You can bootstrap a new repository by using the command". How is a new-comer going to know what bootstrap means? I've been using Git for 2 years and I've never even heard the term myself in this context.

Really consider toning down the jargon, or at least defining the terms before using them.

32

u/regexpressyourself Feb 02 '18 edited Feb 02 '18

That's a great point!

I meant it more in the sense or "pulling yourself up by your bootstraps," but I can definitely see how it could come across as jargon-y or off-putting for people just trying to wrap their heads around git.

Regardless, I'll come up with some better wording. Thanks so much for the feedback!

Edit: fixed! Let me know if you see anything else that might need rewording :)

16

u/Finbel Feb 02 '18

TIL the disambiguation-page for "bootstrapping" on wikipedia has 9 separate pages, from electronics to law.

The general description given there goes

a self-starting process that is supposed to proceed without external input

25

u/[deleted] Feb 02 '18

You never heard bootstrap in a git context because its not a git thing. Basically it just means setting up the basics of something so you can expand on that later on.

7

u/Finbel Feb 02 '18

I try to stay away from using that word generally, it means so many different things in different contexts. It's a specific method to generate data in statistics, it's a well known style framework in webdev, it's an idiomatic saying in everyday speech and TIL "setting something up so you can expand on it later on".

Actually, TIL the disambiguation-page for "bootstrapping" on wikipedia has 9 separate pages, from electronics to law.

The general description given there goes

a self-starting process that is supposed to proceed without external input

6

u/regexpressyourself Feb 02 '18

Probably a good call.

You also forgot: literal "boot straps"

2

u/Finbel Feb 02 '18

Ah! I always knew boot straps were something on boots that you're supposed to be able to pull at but for some reason hadn't made the connection that they're the name for that thing at the back!

3

u/grumpieroldman Feb 02 '18

That's not precise enough to understand what bootstrapping is.

The part that is missing is that you have to do something special or different the first time so get the system working; if there's nothing special/different going on to get it started then there is no bootstrapping.

When you create a git repository you do not do anything special. It's not a bootstrap.

1

u/alpha_hxCR8 Feb 03 '18

me neither.... IMO its best to learn GIT slowly. It may be best for a beginner to stick to git add git commit etc.. and learn as the complexity of your project increases.

Git is a supporting tool.

1

u/saintjeremy Feb 03 '18

How about this, we take "jargon" and replace it with "nomenclature". Language is a living thing and without words to express or describe something a language will die.

  • side note to that, the Welsh (Wales) language does not have a word for Astronaut. The welsh language is struggling to survive.

Bootstrapping a node* what does that mean to you? It's a real thing and should not be derided simply because you're interest spans your existing knowledge.

If you're interested see bootstrapping as a function of automation.

-10

u/otac0n Feb 02 '18 edited Feb 11 '18

It is a common computing term. Every PC users know that their PC "boots up", for example.

1

u/Finbel Feb 02 '18

TIL the disambiguation-page for "bootstrapping" on wikipedia has 9 separate pages, from electronics to law.

The general description given there goes

a self-starting process that is supposed to proceed without external input

8

u/HaileSelassieII Feb 02 '18

What a great resource; excellent job on this!

4

u/bobby_briggs Feb 02 '18

I have to admit, I was confused at first because I use git flow for branch management.

3

u/regexpressyourself Feb 02 '18

This looks interesting, thanks for turning me on to it.

I guess there's no accounting for taste when naming software projects!

4

u/audrikr Feb 02 '18

Just wanted to say, fantastic job! This was really awesome to get the basics of how it works. Thank you for posting this!

1

u/regexpressyourself Feb 02 '18

Thanks so much! :)

2

u/pooch516 Feb 02 '18 edited Feb 07 '18

This is really cool at a glance. I want to play around with it but I love the simplicity of this flowchart.

14

u/kroz58 Feb 02 '18

Ah thank you for posting! I'm currently learning Python and have been using his videos whenever I get stuck. His Learn X Language in One Video are actually really helpful too. Git is my next adventure so I'll have to check this out.

8

u/[deleted] Feb 02 '18

[removed] — view removed comment

2

u/kroz58 Feb 02 '18

Sounds good. I'm only working on solo projects right now so the need for learning git I thought was minimal. I'm starting my capstone next semester so I should probably start learning now so I'm well prepared by then. Thanks for the info.

12

u/poop-trap Feb 02 '18

I haven't found anything better than just reading Pro Git, I have all junior devs who join my team read it. Even if you just read the first three chapters you should be good to go.

2

u/viperex Feb 02 '18

I'm going through that book now. It's really useful and comprehensive

8

u/mzalewski Feb 02 '18

The best git explanation I have seen: git for ages 4 and up.

It helps to realize that first working version of git was designed and written in around two weeks, and that was possible only because it is extremely simple on principle. It is pretty much one-trick pony. If you can visualize git operations as working on DAG, you know about 80% of what there is to learn. DAG means Directed Acyclic Graph; it may sound scary, but if you understand family trees, then you understand DAG at good enough level already.

Another important thing is that git has two levels of commands - lower level (so-called "plumbing") and higher level (so-called "porcelain"). Higher level commands are supposed to be usable by humans, but - because designing good user interface is hard and not exactly git creators strong side - sometimes they feel confusing, contradictory and hard to use. I found them much saner once I learned basic principles and seen how commands are trying to apply them.

11

u/PythonGod123 Feb 02 '18

The title to this thread should be, "if you have watched so many git tutorials and still can't git it try this one."

2

u/Noumenon72 Feb 03 '18

...you stupid git.

2

u/hagerino Feb 02 '18

If you're on Windows, try tortoisegit if you haven't. Windows with buttons to press are easier to learn than a pure console application.

1

u/Noumenon72 Feb 03 '18

So glad to hear someone recommending it. My team is switching from Hg to Git soon and TortoiseHg is so far ahead of Git's tools and usability that TortoiseGit is my main hope.

1

u/[deleted] Feb 02 '18

I’ve been using the desktop app for GitHub. Just started, but was able to create repository and push files. Was as easy as dragging a folder into the app and following prompts.

1

u/[deleted] Feb 02 '18

This is perfect! Thank you so much for posting. Just started using git for a school project a couple weeks ago and it hasn't quite clicked yet for me! Reddit saves my ass yet again!

1

u/[deleted] Feb 03 '18

If there’s anything programming related, chances are Derek Banas has made a tutorial for it. Guys a god

1

u/entdude Feb 03 '18

Thanks for sharing.

1

u/TechSupportBro Feb 03 '18

and simply can't git it try this one ;-)

1

u/DoTheEvolution Feb 03 '18

I like this guys git playlist.

  • videos are like ~2 minutes long

  • great soft voice

1

u/[deleted] Feb 02 '18

This is cool and all but I highly recommend just reading the github documentation on git.

0

u/Matthew94 Feb 02 '18

Just use the official git book. It's free and easy to understand.

4

u/regexpressyourself Feb 02 '18

I tried searching on the net and also reddit for best tutorials for learning github but was mostly redirected to the official docs

Sounds like OP has tried that. I remember it being fairly difficult to understand when I was first learning git as well.

Definitely a fantastic resource once you have the basics down though!

0

u/[deleted] Feb 04 '18

[deleted]

1

u/GitCommandBot Feb 04 '18
git: 'wasn' is not a git command. See 'git --help'.

0

u/[deleted] Feb 02 '18

[deleted]

1

u/smithunbound Feb 02 '18

What exactly do you want automated?

5

u/[deleted] Feb 02 '18 edited Dec 10 '24

[removed] — view removed comment

2

u/Katholikos Feb 02 '18

Not the guy you’re responding to, but there is one thing that annoys me greatly. Let’s say I’m trying to add a file called “HelloKitty.cs” for a commit.

git add HelloKitty.cs

No message in response, adds like normal

git add abehclmaxgeienz.cs

Fatal error: file not found

git add hellokitty.cs

No message in response, nothing is added.

1

u/Starcast Feb 02 '18

git add -p But also this is why I have git status aliased to gs. I spam it all the time.

:)

EDIT: assuming the file is already being tracked, its changes should show up for your approval.

1

u/Katholikos Feb 02 '18

Ah neato. Thanks!

3

u/[deleted] Feb 02 '18 edited Dec 10 '24

[removed] — view removed comment

2

u/Katholikos Feb 02 '18

For sure - unless you use a terminal that doesn’t support that, like my team unfortunately does, haha.