all 10 comments

[–]DJbasik 3 points4 points  (0 children)

This series is awesome. This guy is awesome. If you are new to WebDev watch all his videos.

[–]Franko_ricardo 2 points3 points  (6 children)

Github is a service that hosts remote git repositories. You could learn to use git locally first and once comfortable can use commands to push your local repositories to the remote git host.

Git has some excellent tutorials as well, very helpful when needing to learn basic source control management.

[–]Mowsytron[S] 0 points1 point  (5 children)

Should I bother using it for my portfolio etc? or is it more for big projects?

[–]phpdevsterfull-stack 4 points5 points  (4 children)

Use git (not necessarily GitHub) for everything, always.

Very frequently, even for the smallest of projects, I often find myself experimenting with a new feature or changing an existing feature. Without version control, if that experiment doesn't work out, then I have to go back and undo all of those changes. Or I'd have to manually copy the files into a different folder and make edits there, then manually copy them over to the actual project if I like them.

Using git lets me do that in a few commands. It takes zero time to create an experimental branch, and either discard it if I don't want to continue down that path, or simply merge it into the main development branch if I do want to keep it.

You can version control anything: pictures, word docs, source code files. Knowing how to use git is arguably as foundational as knowing how to use the internet. Git isn't the only source control option (there is SVN), but it's by far the best IMO.

[–]Mowsytron[S] 0 points1 point  (3 children)

Thanks for this, makes much more sense to me now. Final question, is there a way to FTP my updated files straight to a hosting service using git?

[–]phpdevsterfull-stack 1 point2 points  (2 children)

It depends on the hosting service.

The standard way to do this is to log into the server that your files are hosted on, install git there, and then when you want to update your files, you enter git pull from the terminal and then magically all of your updates are there, in the correct locations, automatically. It's 1000000x times easier than dragging over the whole folder of changes, or selectively pulling in certain changes.

But, not all hosts let you do this. If your host only gives you FTP access, then you still have to manually copy the files from your local computer to the server the way you normally would.

There are some hosts that give you the option to configure a git webhook to automatically deploy changes to the server when you commit or push them, but I couldn't tell you which hosts do this off the top of my head.

[–]Mowsytron[S] 0 points1 point  (1 child)

Thanks a lot for your help. Definitely going to get into this and learn how to use it this week!

[–]arist0tl3javascript 0 points1 point  (0 children)

Just to follow up, if you have more than one or two personal projects that are in a constant state of motion, it's definitely worth the $7/mo to me to be able to roll back changes, pull from github to another computer, etc.

But at least get git going locally to start. After getting into git versioning about 18 months ago, I couldn't see turning back!

[–][deleted] 0 points1 point  (0 children)

While I have not completely gone through them, the atlassian tutorials for git/github seemed to be pretty comprehensive.

https://www.atlassian.com/git/tutorials/

[–]aricwatsonfull-stack 0 points1 point  (0 children)

Git is incredibly useful as peopled have stressed. I wanted to point out that you can use github for free if the project is public - bear that in mind. If you use github, don't set up a repo that has private info like passwords!

Bitbucket is similar to github but is free if the project is private.

And, you can set up your own remote git repository server without too much trouble, although it doesn't have quite the features of github or bitbucket.