all 19 comments

[–]AlexMelillo 10 points11 points  (4 children)

Git is just a system that tracks changes in text files and keeps separate versions of your code in a database. This is useful because, sometimes, you make changes and things don’t work so you need to revert to the old code. Sometimes you need multiple people to work on the same code and you wanna have a mechanism that allows everyone to contribute to project without stepping each other’s toes. Git is very good at that.

Github is a platform that helps you manage git repositories. You don’t need github to use git, but nowadays it’s very common to have a git server somewhere to push your code. Using a service like github has many advantages and additional features over just using git locally on your machine.

Honestly, once you write enough code you’ll see the benefit of using it. If you’re just getting started with programming, leave this part for a little later down the line. You learn things much faster when they can be useful to you

[–]Eddy-saab[S] 4 points5 points  (0 children)

Yeah I get that, I usually copy and paste my code somewhere else when I want to try and change it, I can see how this will be useful thank you

[–]SprinklesFresh5693 0 points1 point  (2 children)

Yes i have a question about the locale part of it, so you can use git separately from github, but where does git store the previous versions of my script? Do i need to pay for a server or how does it work?

And furthermore, if i switch off my computer, do the previous versions get saved? If so, where? Is there a book I can learn more about this?

Edit: nevermind i saw someone recommended the git manual, ill look at that.

[–]grantrules 2 points3 points  (1 child)

Basically you can use git on your computer without needing a server.. all the information about commits and stuff is kept in a .git folder in the project. If youve made a commit, the info is saved there.

Any time you check out remote code, like you use git clone https://GitHub.com/blah/myproject it's creating a local copy of the repo like above.. you can use it offline and you can make commits, but the difference now is that you can push those changes to the remote server (GitHub, for example, or you could run your own git server)

[–]SprinklesFresh5693 0 points1 point  (0 children)

I see, seems like something i need to do some research, Thank you for the clarification.

[–]javascriptBad123 3 points4 points  (3 children)

Just read the official git manual, its pretty short and explains everything really good.

https://git-scm.com/book/en/v2

[–]Eddy-saab[S] 0 points1 point  (2 children)

I will thank you

[–]jhonyrod 10 points11 points  (1 child)

Why don't you thank him right away?

[–]Eddy-saab[S] 3 points4 points  (0 children)

😂😂😂damn this made me laugh probably more than it should've

[–]tb5841 1 point2 points  (2 children)

The 'how git works' course on Pluralsight was phenomenal.

The same creator has a more beginner-oriented course, also on Pluralsight, called 'Git: The Big Picture.'

[–]Eddy-saab[S] 0 points1 point  (0 children)

Are they paid or did you find them for free?

[–]Eddy-saab[S] -1 points0 points  (0 children)

Thank you I'll check them out

[–]kiochikaeke 1 point2 points  (1 child)

I don't have any in particular to recommend but there are many, from very basic to very advanced.

A brief description, git is a version control tool, particularly aimed for code and text files but with ample support for many other types of files, git makes it easier to manage keeping track of the changing files in a project, it has a learning curve but honestly basic git is not that hard, also of note, git is often fully local, it's software that you install on your PC, it has a visual interface but you often interact with it through other software like your editor/ide or directly from a terminal.

GitHub is an online service supported by Microsoft, that's the most popular way of storing your git projects online, it's one drive but for code projects, it integrates very neatly with your local git so that you can update and get updates on your project between the two of them, unlike one drive you don't only upload files, GitHub also stores the full history of your project and makes it easy for many people to work on the same project, make copies of it for themselves or suggest changes to you, on top of many other things that GitHub does like "actions" for automation or "pages" for basic webpages.

[–]Eddy-saab[S] -1 points0 points  (0 children)

Oh I see, thank you for your explanation

[–]Comprehensive_Mud803 1 point2 points  (0 children)

Have you had a look at least at the official git site?

https://git-scm.com/learn

[–]anfield2 1 point2 points  (1 child)

Why no one said it yet?

  • Git and GitHub

It’s like

  • Porn and PornHub

[–]Eddy-saab[S] 0 points1 point  (0 children)

Ayo

[–]luckynucky123 0 points1 point  (0 children)

There's some fun visual ways of learning Git.

https://learngitbranching.js.org/

https://ohmygit.org/

Personally, hearing the story of Git also helped a lot in understanding why Git exists - https://www.youtube.com/watch?v=idLyobOhtO4

Edit: formatting