Search code examples
gitgit-push

Pushing local repository to server


Up till now, I worked on a local repository ( locally initialized, not cloned ). Because I am working on more than one workstation, I decided to "go online" and want to push my repo to server. Also, I want to push all branches.

So question is: Is there any way of pushing whole locally initialized repo ?


Solution

  • To make things easier, start by creating a remote if you haven't already:

    git remote add origin <server repo url>
    

    Now you can do this:

    git push --all
    

    to push all branches to origin, the default remote. (If you name it something else, you'd have to specify it as an argument.)