19

Our git server will be local, but we want an server where our local repo is also kept online but only used in a push to fashion.

How can one do that?

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
Ravi Chhabra
  • 1,730
  • 3
  • 18
  • 27

1 Answers1

34

You can add remotes with git remote add <name> <url>

You can then push to a remote with git push <name> master:master to push your local master branch to the remote master branch.

When you create a repo with git clone the remote is named origin but you can create a public repository for your online server and push to it with git push public master:master

Grégoire Cachet
  • 2,547
  • 3
  • 29
  • 27