Wednesday, March 12, 2014

Create New Git Repo

Yep, this should be basic, but I always can't memorise the commands. Here, I am writing them down.

p.s. let's use git@heron.nctucs.net:~/heron-web.git for example.

On Git Server Side

  • mkdir heron-web.git
  • cd heron-web.git/
  • git init --bare

In My Local Code Directory

  • cd <path-to-the-code>
  • git init
  • vim .gitignore
  • git add -A
  • git commit -a -m "init commit"
  • git remote add original git@heron.nctucs.net:~/heron-web.git
  • git push -u original master

Clone in Other Place

  • git clone git@heron.nctucs.net:~/heron-web.git
  • cd heron-web