Git - How to setup a git remote repository
There are lots of search results on “How to setup a remote Git repository” on google. However, it’s really tough to find proper link. Hence, I read couple of blogs on this article and noted down key steps on this article. This posts is more of a note to self as I keep forgetting the steps needed to set up a GIT remote repository.
Let us first setup remote git repo
Cool!! So, we have setup a remote repository. Now, let us push some files on the remote repository from our local machine.
We have create a local repository. So let us push all files to server
git remote add origin username@hostname:git-remote.git
git remote add
just creates an entry in your git config that specifies a name for a particular URL. You must have an existing git repo to use this.
Lets push to remote repo
git push -u origin master
Suppose if you remember the username and host then you can following:
git push username@hostname:git-remote.git
Done.