Asking about Git/GitHub

I'm new about this and i was so confused how Git and GitHub works i can't even can't find a perfect answer for my curiosity - What the proper way to install the environment for using GitHub features (what do i need, what is necessasry) - Do i need to install both Git and GitHub Desktop on my PC to be able to access GitHub functions? - I knew that GitHub is helpful when using on cloud because it cloud-base and Git is locally saved in my PC. but its still good or necessary to using it nowadays even GitHub can do a lot like Git (correct me if im wrong) - Why GitHub using same command like git init, git push, etc. (i've read a blog about Git and it says this) and its still works to push my sources into GitHub cloud even its just a command for Git not GitHub (its not the same author. are they cooperated?) - Are we using both relatively? Also, - If i'm using VSCode's integrated version control from sidebar is it pushing for Git or GitHub? (is commit/push from sidebar and terminal is it have different outcomes?) - How long does it take to commit or push files (both Git & GitHub) is it depends on user's internet connection? (fyi: my PC have great connection but my phone don't. when i have to go out and remote the project from my phone. will my poor connection makes the project takes longer?) Thank you for answers. I know its a lot but i really want it to be clear
5 Replies
vince
vince2mo ago
Git is a way to locally version your directory (repository). GitHub is just a website you upload git repositories to and have developers collaborate. You don't need GitHub desktop or any other third party software; git is sufficient. It's all git Cloning / pushing git repositories from github will rely on your internet speed
rik
rik2mo ago
It's always a good idea to have the command line tools installed. You only need the git ones, you don't need the GitHub ones. GitHub is a website that hosts git repositories. It also provides the infrastructure for build services and hosting. While most of this is configurable with just text files or the website, there's a few things that I'm sure the GitHub Desktop thing makes easier. Separating git from GitHub is the first thing you need to understand. Cloning a repository locally means that you have a copy of it at a moment in time. To collaborate with other people you'll need to push and pull the changes. These also act as triggers for the Actions, if you have any. VSCode's git functionality (I can't remember if it's a plugin or not, anymore) is a wrapper around git. A slower connection will take longer, but you're not pushing large amounts of data around, hopefully.
salentipy
salentipy2mo ago
Why GitHub using same command like git init, git push, etc. (i've read a blog about Git and it says this) and its still works to push my sources into GitHub cloud even its just a command for Git not GitHub (its not the same author. are they cooperated?) Are we using both relatively?
This is something I'm curious about as well. Using regular GIt commands on your local computer with GitHub's resources on their server. How does the local GIt know to push/pull the info from GitHub's servers? Is that something that's just included and set up ahead of time? or do you add it into the local settings somehow? Hopefully, I asked that properly
Jochem
Jochem2mo ago
github is purely a hosting service for git repositories, with a bunch of extra features. Git repositories have a concept called "remotes" which are places that you define in your repository to be the "upstream" of your local copy. Basically, you tell a repo that if you run "push" that's where its supposed to push to when you clone a repo you or someone else made on github, it's automatically set up to have the github repo as the remote you can also add remotes to existing repos, including adding github repos as a new remote target If you want to know more about git, I'd recommend reading the git book. You can stop when it gets too complicated, or pick and choose chapters, but I'd recommend reading at the very least the first two You can also very easily set up your own remote git repo, or use a different service like gitlab or bitbucket. Your own remote wouldn't have any of the fancy features github and the others have, it's basically just a second place for your code to live, you don't get a webinterface or any of the other features that don't interact witl git push and git pull.
salentipy
salentipy2mo ago
Thank you so much for that. When I first set GIt up on my machine, I was following step-by-stepy instructions, so I figured that's probably when I gave it instructions on where to put repositories - it was just all so foreign, I didn't remember specifically doing that. I have read up on Git and GitHub enough to know the basic differences between the two, but I only took it as far as I needed it right now to be able to handle my info and for me to learn more about how to use it because - apparently - all employers (or almost) use GIt now as a way to collaborate. It is definitely still on my list to dig deeper into. Not understanding it more bothers me. But the list of things I need to focus on is already so long right now, picking one or two or three is extremely difficult. So, I"m trying to focus the majority of my time and learning on HTML (being more semantic and accessible), CSS, and learning JavaScript. Thanks for the link to that Git book. I know I accessed that website for some information at some point, but I do not remember what it was. Appreciate it!!