Henry
Henry

Reputation: 1795

Does every development machine need to install a server to push code to GitHub?

I'm new to Git/GitHub and I'm really struggling to push my local repos to the remote repos I've set up on GitHub. I started reading the Git manual and the reference book and found myself getting more confused that educated.

As I understand it, the two major options for pushing local repos to remote repos are HTTPS and SSH. Having looked at the process for setting up SSH and finding it complicated and unclear in some respects, I think I'd like to stick with HTTPS for now. The book talks about setting up servers but I'm not at all clear about that. Do I need to set up a server on my local machine to push my code to the remote repo? Aren't the HTTPS versions of the commands sufficient? Or is setting up a server an option that might simplify some aspects of pushing code to my remote repos?

I'm deliberately NOT including any code in this question because I view it as a concept question. This seems to be the key concept that I need to understand to figure out why my pushes aren't working. Once you've answered this question, I hope I can frame a coherent question about my specific problem with pushing code to my remotes.

Please understand that I'm new to Git and seem to have some fundamental gaps in my understanding of the concepts so please don't assume a deep knowledge of Git. This is essentially my first version control system since Panvalet, a mainframe tool we used in the 80s. Also, I should mention that my local machine is running Windows 10 and the current version of Git Bash.

Upvotes: 2

Views: 233

Answers (2)

Timo Reymann
Timo Reymann

Reputation: 895

first a warm welcome to the git community! :)

To clarify some things first: git is a decentralized vcs, you typically use a server as a central point to store your repository, but every machine can keep its own version of your repository.

In your case you are using GitHub. They are hosting a server for you, so you only need an GitHub account, and create a repo there. From this point you can use https/ssh as protocol layer to sync your changes to the github servers.

Just run git push and Git will ask your for credentials (at first), after that the windows credentials manager keeps track of your username and password on your local machine.

Git Workflow (taken from https://dzone.com/articles/git-tutorial-commands-and-operations-in-git)

Upvotes: 2

SwissCodeMen
SwissCodeMen

Reputation: 4895

No, you don't need to set up a server on your local machine, when you will need the functionalities of git.

You just have to connect (with SSH or HTTPS, as you have already correctly recognized in the question) your local repository to the remote repository on the git server (GitHub, GitLab, BitBucket...). And after connected, you can need the full functionalities from git.

If you would have a own git-server on your system (for example, on your Synology NAS), then you must setting up your own git server, otherwise, you don't need to set up a server, that's what GitHub, GitLab, BitBucket... does.

Upvotes: 2

Related Questions