GitHub from terminal? Why bother

So, I’m going through the tutorials on https://try.github.io/ for using github. As I’m working SxS with my gitbash terminal and test repo, my repo refuses to connect in gitbash, so I open a terminal session, worse, I can connect but no commit because the repo I just told git to create doesn’t exist!!! Well, I go hunting for a solution to these 2 issues and well, well looky here: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ and https://help.github.com/articles/create-a-repo/

You have to login to a browser, setup an empty repo, then go back to a terminal window???

Why bother to use a command line anyways? I’m already logged into your site via a browser … makes absolutely no sense.

1 Like

How else would you push your new commits from your local machine to your online repo? Manually upload them?

One doesn’t typically create a new repository very often. If I understand what you’re saying, that’s the only part that has to be done via the browser. Then you continue on your merry way for years, doing what you need to do using normal git commands.

@Tan-Moy There’s a desktop GUI for GitHub, so I guess that’s an alternative.

Yeah I know, but last I checked it didn’t support Linux. Tbh since I like the terminal based git much better and use it exclusively I forgot all about the gui github till you mentioned it now :sweat_smile:

1 Like

GitKraken is a GUI that runs on Linux, but only on 64-bit versions.

3 Likes

here are some examples how I am using git

  • my linux laptop => pull & push via cli only
  • my Mac => pull & push via the MacOS app
  • my android phone => android app. usually writing issues for my (private) github.com account
  • gitlab server at work => issues, wiki, snippets, milestones like mini project mgmnt
  • servers at work => scheduled updates (cron) of production code via git pull

That last bullet point should answer your question. The moment you deal with automation and backend stuff the CLI is king - simple and reliable.

1 Like

Github is actually just a website that hosts remote Git repositories. By the very nature of distributed version control (which Git is), your working copy will be located on your machine. You need to use the Git command line or some other interface to it (Gitbash in your case I bet, though I don’t use that) to work locally. Then you push those changes to Github. Github allows you to create repos from the command line in case you already had some repo you worked on locally that you want to put to Github. It also allows you to create the repo in the web UI but you will not see it in Gitbash unless you clone it locally.

1 Like

Because it’s easier. If it isn’t easier to you, don’t do it, this logic applies to anything.
First you should understand by yourself why is it’s easier, if you agree with the norm, use the norm. If you don’t, don’t use the norm. The only one who cares about your productivity is you after all.

1 Like