Skip to content

Instantly share code, notes, and snippets.

@gokman
Created May 20, 2017 10:36
Show Gist options
  • Select an option

  • Save gokman/b73355a19a2ac066791c7994d584c514 to your computer and use it in GitHub Desktop.

Select an option

Save gokman/b73355a19a2ac066791c7994d584c514 to your computer and use it in GitHub Desktop.
create bare git repository
#create a folder
mkdir {git repo folder}
Ex: mkdir /opt/myrepo
#initialize git repository
git init --bare {git repo name}.git
Ex: git init --bare myrepo.git
#create git remote address
git remote add {remote name} {bare repository address}:{folder}/{git repo name}.git
Ex: git remote add myremote user@0.0.0.0:/opt/myrepo/myrepo.git
#push your changes to the newly created bare repo
git push {remote name} {branch name}
Ex: git push myremote master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment