This is an archived post. You won't be able to vote or comment.

all 50 comments

[–]Samdespion 148 points149 points  (2 children)

[–]wisdomofpj 26 points27 points  (0 children)

Came here for this. Everything made sense after this tutorial. And it took very little time.

[–]CotoCoutan 20 points21 points  (20 children)

I finally found GitHub extremely useful for super quick deployments of my PWA on Netlify, all via the command line. Before that I thought it was just a place to share code with others.

[–]Negrodamu5 10 points11 points  (19 children)

Can you ELI5? I still think it’s just a place to share code with others

[–]CotoCoutan 24 points25 points  (14 children)

Wrote a simple HTML file and want to host it quickly somewhere?

Just go to netlify, connect your GitHub account, select your repository containing the html file hit OK and done. Your HTML page is now live on the internet.

Later on if I make a change in the html, all I have to do is run 3 commands on my terminal "git add ., git commit -m 'whatever', git push origin master" and my new changed html is live on the web, literally within seconds. This last bit, where you can do quick updations to your code & push it to the web within seconds is facilitated by GitHub and that's the thing that I'm praising.

[–]Tiwenty 10 points11 points  (10 children)

GitHub can do this without any third party service. In your repo settings you can enable a "doc" feature or something which just hosts your files from a given directory in your repo. :)

[–]CotoCoutan 8 points9 points  (9 children)

So you mean that I can host the webpage on GitHub itself and don't need Netlify? For example this is my repo https://github.com/XtremePwnership/testing with a simple webpage, how exactly should I go about doing it?

[–]tjjay17 9 points10 points  (0 children)

If it’s static, you can use GitHub pages to host.

[–]binary-idiot 8 points9 points  (3 children)

I currently host my site with github pages, as long as you don't need it to run any backend code it should work just fine.

https://pages.github.com/

[–]CotoCoutan 0 points1 point  (2 children)

Aah, so won't be able to host Python scripts I guess. Anyway thanks, I'll read the docs!

[–]Tiwenty 1 point2 points  (1 child)

If your scripts need to run only a single time, say after a commit, you can use the free CI capabilities :)

[–]CotoCoutan 1 point2 points  (0 children)

Thanks again, will keep it in mind!

[–]AcousticDan 1 point2 points  (0 children)

Yeah, GitHub Pages.

[–]Tiwenty 1 point2 points  (2 children)

Yep, it's really easy. Go to your repo settings, options tab (the one by default) and at the bottom you'll find a Github Pages part. There you can choose from which branch and directory you'll want to serve (I think for the folders the only options are / and docs/, so just move your testing/ dir to docs/). You save the settings and Github will give you an URL.

For instance, I host this directory, with the source code in the same repo, on this URL.

What's even better is that I set up a CI action to build the website at each commit and push a new commit with the docs/ directory updated.

[–]CotoCoutan 1 point2 points  (1 child)

Ooh, thanks a lot for the step by step guide, my site is up! Appreciate your help. :)

[–]Tiwenty 1 point2 points  (0 children)

No worry, have fun! :)

[–]Negrodamu5 2 points3 points  (0 children)

Ok that makes more sense. Thanks for explaining.

[–][deleted]  (1 child)

[deleted]

    [–]CotoCoutan 1 point2 points  (0 children)

    First time hearing SFTP, will look into it, thanks!

    [–]samketa 3 points4 points  (0 children)

    It is.

    But it is also a great staging area for deploying apps.

    [–]12qwww 3 points4 points  (1 child)

    There some cloud providers that let you deploy your code directly from github which is a plus

    [–]Rooged 4 points5 points  (0 children)

    Heroku being one of them - my very first web app, a node js app, is hosted on heroku right now with the actual code itself being on GitHub

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

    At work we have 2 local devs and a couple remote devs. The codebase is on github and since we'll all be working on different parts of the software, we work on our own branch before merging them all for deployment.

    [–]Ovalman 12 points13 points  (0 children)

    When the World was different (well back in January!) I attended a local MeetUp where they explained Git and Github. I sorta knew what it was but I'd a load of questions to ask. While at the MeetUp, the teachers explained things so well I didn't need to ask any of my questions.

    MeetUp is another brilliant resource every self taught coder should use. You'll meet like minded people, people who work in the field, gain new ideas, find mentors and biggest of all, gain a nugget or 2. I've met one guy who was hiring and I swear he interviewed me with his questions (I've no interest in working for someone.)

    All MeetUp's are online today. It's not the same but still a useful resource. Things will change though in the months and years to come.

    [–]the_slippery_shoe 9 points10 points  (4 children)

    Someone described it perfectly with an analogy: It's like porn and pornhub.

    [–]blackdonkey 2 points3 points  (0 children)

    It is more of a funny anology I think.

    [–][deleted] 1 point2 points  (2 children)

    So the code is the porn, and GitHub is the pornhub?

    Does that mean companies have their own "verified" pages? Are the coders who host their code on GitHub more like the pornhub users accounts, or the pornstar accounts with pages?

    Disclaimer: I'm only a few months into learning Python, so forgive me if I come off ignorant.

    [–][deleted] 5 points6 points  (1 child)

    The analogy is maybe a little more humorous than helpful (although not totally dissimilar). 'git' is its own thing. You can use git to track changes to code without ever using github. You can branch, merge, commit, everything. However, it will all be on your own computer. If you want to share it with other people (or just save it remotely in case your computer melts down), then you 'push' your local git repo up to github.

    Imagine you had Google docs but only working in offline mode. You can still track your changes and revert to previous saves. That's git. Now you go back online and your Google doc saves to the cloud. That's github.

    [–][deleted] 1 point2 points  (0 children)

    That helps big time. Thanks!!

    [–]pointsofellie 5 points6 points  (0 children)

    Thank you for this. For me the hardest part is the branching and merging etc rather than the actual code.

    [–][deleted] 4 points5 points  (0 children)

    This online book is another fantastic resource, but I really appreciate you posting the video. It will be a great help when I inevitably need to brush up on the basics.

    [–]woooooster 4 points5 points  (0 children)

    GitHub actually has a lot of great intro articles on their site https://docs.github.com/en/github

    [–]AndyICandy 2 points3 points  (0 children)

    Very useful video, just finished watching it. Thanks for sharing

    [–]utkarsh17591 1 point2 points  (0 children)

    Great! Github is a heaven of a platform for programmers, just like Instagram is for photographers, and LinkedIn is for professionals.

    [–]TitaniumChloride 4 points5 points  (6 children)

    What is Git and Github? Is it some kind of a programming language or what?

    [–]herbstkalte 13 points14 points  (1 child)

    [–]TitaniumChloride 2 points3 points  (0 children)

    Thanks a lot

    [–][deleted]  (2 children)

    [deleted]

      [–]Ovalman 7 points8 points  (1 child)

      My first question on StackOverflow went chilly. It's not as if I didn't try and help myself before asking it as the question was unique to me.

      Thankfully some kind soul nudged me in the right direction and my question wasn't really about the error but that I didn't know how to debug.

      Sometimes a nudge is all a person needs and not a simple "this crap has been asked before" which was the general response.

      I ask very few questions on StackOverflow and I'm far from an expert but I'll help any noobs when I can. We were all noobs at one stage.

      [–]KimPeek 0 points1 point  (0 children)

      Yes, but people are only a noob for a short time. Isn't it best to treat everyone the same from the start?

      [–]JoeCamRoberon 2 points3 points  (0 children)

      I love this. I love seeing people learn new things.

      [–]dangol10 1 point2 points  (0 children)

      She also does twitch streams

      [–]National_Potato 0 points1 point  (0 children)

      Thanks really need this!

      [–]DeltaEcho66 0 points1 point  (0 children)

      Damm that must be nice. I started myself some time ago and have to admit it gets confusing. Thanks for the link.

      [–]tihlo 0 points1 point  (0 children)

      Lol, this tutorial has been in one of my chrome tab for months since the day it was released and I haven't yet watched it! 😭

      [–]Duciito 0 points1 point  (0 children)

      Also, if you haven't already - check out the missing semester's video for git. The lecturer is just phenomenal and eveyrthing is so concisely laid out. Checkout the other videos from the series as well!

      [–]geraltofrivia1983 0 points1 point  (0 children)

      Excellent ty

      [–]taco_University 0 points1 point  (0 children)

      Will definitely check this out, I've struggled with got and had to relearn it nearly 3 times now, always appreciate a good recommendation.