Skip to content

Instantly share code, notes, and snippets.

@alassiter
Created April 12, 2013 18:32
Show Gist options
  • Save alassiter/5374111 to your computer and use it in GitHub Desktop.
Save alassiter/5374111 to your computer and use it in GitHub Desktop.
Create a new Git Repo
# ---- ON LOCAL MACHINE ----
git init
git add *
git commit -m "Initial Import"
# ---- END LOCAL MACHINE ----
# ---- ON SERVER -----
cd to_git_repo
sudo mkdir name_of_app.git
sudo chown git:git name_of_app.git
sudo chmod g+w name_of_app.git
# Become the git user
sudo su git
# Change into the new app directory
cd name_of_app.git
# Initialize the directory for git
git --bare init --shared=true
# ---- END SERVER ----
# ---- ON LOCAL MACHINE ----
git remote add origin ssh://git@name_of_server.com/path_to_repos/name_of_app.git
git push -u origin master
# ---- END LOCAL MACHINE ----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment