How to initialize a remote Git repository

Well, since it took me all day to figure this out again, I figured I might as well write it down somewhere so that at least I’ll be able to remember it the next time I want to create a new repo with Git.

The one thing that irks me is that I always try to create a bare repo on the server and then clone it to my client.  For some reason git doesn’t want to work this way even though that’s what my intuition tells me.

Anyway, the way to do it is to first create your working copy.  I’m making a little website so I have some code in /www/my-working-copy.  After you have some code that you want in the repo, you need to initialize a git repository and add your code to it like so:

git init
git add .

After that’s done, you want to go your git-daemon’s base path and clone this repo there with a bare copy:

cd /my-git-daemon-base-path && git clone –bare /www/my-working-copy my-remote-repo

You should get a message like “Initialized empty Git repository in /my-git-daemon-base-path/my-remote-repo/” after which you may need to run update-server-info and you’ll also want to add a ‘git-daemon-export-ok’ file to the repo so that the daemon knows that it is okay to export it:

git update-server-info
cd /my-git-daemon-base-path/my-remote-repo && touch git-daemon-export-ok

At this point you also will most likely want to add a ‘tracked repository’ named ‘origin’ to your working copy so that git will know where you want to push and pull from:

cd /www/my-working-copy && git remote add origin /my-git-daemon-base-path/my-remote-repo

That’s it!  To test it out simply try a commit:

git commit -a

You should receive a message “nothing to commit (working directory clean)”.

At this point you probably want to push your changes to the repo.  Although the repo is created, it won’t be very useful until there’s something in it:

git push origin master

Cheers!

Tags: , , , ,

172 Responses to “How to initialize a remote Git repository”

Alexander6 Says:

buy@generic.VIAGRA” rel=”nofollow”>…

Need cheap generic VIAGRA?…

Alexander7 Says:

buy@generic.LEVITRA” rel=”nofollow”>…

Need cheap generic LEVITRA?…

ANGEL Says:

Order@Coral.Calcium.Online” rel=”nofollow”>..

Buygeneric pills…

LEWIS Says:

Purchase@Cheap.Coral.Calcium” rel=”nofollow”>..

Buynow it…

EDUARDO Says:

Buy@Cheap.Abana” rel=”nofollow”>..

Buygeneric pills…

TERRENCE Says:

Get@Abana.Online” rel=”nofollow”>..

Buyit now…

SALVADOR Says:

Buy@Abilify.Online” rel=”nofollow”>..

Buygeneric meds…

RONNIE Says:

Buy@Cheap.Abilify” rel=”nofollow”>..

Buynow it…

PERRY Says:

Purchase@Abilify.Online” rel=”nofollow”>…

Buywithout prescription…

DUSTIN Says:

Get@Abilify.Online” rel=”nofollow”>..

Buygeneric drugs…

ENRIQUE Says:

Cheap@Abilify.Without.Prescription” rel=”nofollow”>.

Buynow it…

BRANDON Says:

Buy@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..

Buyno prescription…

ROY Says:

Buy@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>…

Buywithout prescription…

RUSSELL Says:

Purchase@Discount.Acai” rel=”nofollow”>..

Buywithout prescription…

SALVADOR Says:

Cheap@Acai.Online” rel=”nofollow”>…

Buynow…

ARTHUR Says:

Buy@Coral.Calcium.Online” rel=”nofollow”>.…

Buygeneric meds…

RONALD Says:

Buy@Cheap.Coral.Calcium” rel=”nofollow”>…

Buygeneric meds…

GABRIEL Says:

Order@Cheap.Abilify” rel=”nofollow”>..

Buyno prescription…

RALPH Says:

Buy@Cheap.Acai” rel=”nofollow”>…

Buygeneric drugs…

GUY Says:

Buy@Cheap.Acai” rel=”nofollow”>.

Buywithout prescription…

SAMUEL Says:

Buy@Cheap.Acai” rel=”nofollow”>…

Buygeneric drugs…

FELIX Says:

Order@Acai.Online” rel=”nofollow”>…

Buyit now…

WALLACE Says:

Order@Acai.Online” rel=”nofollow”>…

Buygeneric drugs…

JEFFREY Says:

Order@Acai.Online” rel=”nofollow”>…

Buynow it…

DONALD Says:

Order@Acai.Online” rel=”nofollow”>…

Buyit now…

ALFRED Says:

Order@Discount.Acai” rel=”nofollow”>…

Buynow…

NATHAN Says:

Order@Discount.Energy.Boost” rel=”nofollow”>.…

Buynow it…

SAM Says:

Purchase@Discount.Energy.Boost” rel=”nofollow”>.…

Buynow it…

RUBEN Says:

Buy@Cheap.Accupril” rel=”nofollow”>.…

Buygeneric meds…

ADAM Says:

Buy@Discount.Accupril” rel=”nofollow”>.…

Buyno prescription…

BOB Says:

Order@Accupril.Online” rel=”nofollow”>.…

Buygeneric drugs…

BILLY Says:

Purchase@Accupril.Online” rel=”nofollow”>.…

Buygeneric drugs…

BYRON Says:

Buy@Discount.Accutane” rel=”nofollow”>.…

Buynow it…

BRUCE Says:

Order@Cheap.Accutane” rel=”nofollow”>.…

Buygeneric drugs…

CARL Says:

Buy@Cheap.Aciphex” rel=”nofollow”>.…

Buygeneric meds…

ANDREW Says:

Cheap@Aciphex.Without.Prescription” rel=”nofollow”>.…

Buynow it…

KENNY Says:

Buy@Acomplia.Online” rel=”nofollow”>.…

Buynow it…

ROY Says:

Cheap@Actonel.Without.Prescription” rel=”nofollow”>…

Buynow it mou…

LUIS Says:

Cheap@Actonel.35mg” rel=”nofollow”>…

Buyit now oil…

CLIFTON Says:

Cheap@Generic.Actonel.35mg” rel=”nofollow”>..

Buygeneric meds qmo…

LAWRENCE Says:

Get@Actos.Online” rel=”nofollow”>..

Buywithout prescription dyo…

VICTOR Says:

Order@Actos.Without.Prescription” rel=”nofollow”>..

Buygeneric pills zdg…

RAY Says:

Cheap@Generic.Actos.15mg.30mg” rel=”nofollow”>.

Buygeneric drugs zfk…

RODNEY Says:

Order@Cheap.Adalat” rel=”nofollow”>..

Buygeneric drugs lzt…

SERGIO Says:

Purchase@Adalat.Online” rel=”nofollow”>.

Buyno prescription luw…

LLOYD Says:

Cheap@Coral.Calcium.Online” rel=”nofollow”>…

Buywithout prescription xiu…

JEREMIAH Says:

Buy@Generic.Abilify.Without.Prescription” rel=”nofollow”>..

Buynow it tly…

MARION Says:

Order@Cheap.Acai” rel=”nofollow”>..

Buyno prescription gdt…

MARION Says:

Buy@Generic.Acai” rel=”nofollow”>.

Buygeneric drugs mby…

JERRY Says:

Cheap@Generic.Acai” rel=”nofollow”>…

Buydrugs without prescription vrg…

BRETT Says:

Cheap@Acai.Without.Prescription” rel=”nofollow”>…

Buydrugs without prescription jlg…

JOEL Says:

Generic@Acai.500mg.Without.Prescription” rel=”nofollow”>..

Buyno prescription wkp…

STEVEN Says:

Buy@Discount.Energy.Boost” rel=”nofollow”>.

Buygeneric drugs itj…

BRYAN Says:

Buy@Cheap.Accupril” rel=”nofollow”>.

Buygeneric drugs nih…

AUSTIN Says:

Order@Cheap.Accupril” rel=”nofollow”>.

Buynow it fnp…

RONNIE Says:

Cheap@Accupril.Online” rel=”nofollow”>..

Buygeneric drugs ajd…

LEROY Says:

Order@Accutane.Online” rel=”nofollow”>…

Buyit now sge…

GLENN Says:

Order@Cheap.Accutane” rel=”nofollow”>..

Buyno prescription tao…

JASON Says:

Purchase@Cheap.Accutane” rel=”nofollow”>…

Buywithout prescription ccw…

VINCENT Says:

Cheap@Accutane.10mg.20mg” rel=”nofollow”>.

Buyit now ojb…

BRUCE Says:

Buy@Accutane.10mg.20mg” rel=”nofollow”>…

Buynow it zdg…

MARVIN Says:

Order@Aciphex.Online” rel=”nofollow”>.

Buynow it lmg…

MITCHELL Says:

Order@Cheap.Aciphex” rel=”nofollow”>..

Buydrugs without prescription faj…

JOHNNY Says:

Order@Discount.Aciphex” rel=”nofollow”>…

Buygeneric meds svb…

BRUCE Says:

Purchase@Discount.Aciphex” rel=”nofollow”>..

Buyno prescription jui…

DUANE Says:

Purchase@Discount.Acomplia” rel=”nofollow”>..

Buynow it sgk…

MILTON Says:

Buy@Actonel.Online” rel=”nofollow”>..

Buydrugs without prescription hak…

CARLOS Says:

Purchase@Actonel.Online” rel=”nofollow”>…

Buygeneric drugs vbr…

VINCENT Says:

Purchase@Cheap.Actonel” rel=”nofollow”>.

Buydrugs without prescription xab…

GERARD Says:

Order@Advair.Online” rel=”nofollow”>..

Buyit now irl…

DWAYNE Says:

Buy@Generic.Advair” rel=”nofollow”>.

Buygeneric drugs ouw…

SHANE Says:

Buy@Advair.Without.Prescription” rel=”nofollow”>.

Buygeneric drugs hwi…

EVAN Says:

< a href=”http://trig.com/advair5771/biography/?ml=Advair-25mcg/50mcg-25mcg/125mcg-25mcg/250mcg-50mcg/500mcg-50mcg/100mcg-50mcg/250mcg-Without-Prescription Advair@25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg.Without.Pr

Buydrugs without prescription ygy…

ALVIN Says:

Buy@Cheap.Aggrenox” rel=”nofollow”>..

Buygeneric meds dxy…

BILLY Says:

Get@Aggrenox.Online” rel=”nofollow”>…

Buynow fjl…

RENE Says:

Order@Cheap.Albenza” rel=”nofollow”>…

Buynow it sxk…

NATHAN Says:

Purchase@Cheap.Albenza” rel=”nofollow”>…

Buyit now knc…

BRAD Says:

can@you.take.aciphex.and.nexium.at.the.same.time” rel=”nofollow”>..

Buygeneric pills…

DARRYL Says:

actonel@and.heart.irregularities” rel=”nofollow”>..

Buyno prescription…

TIM Says:

.

Buynow…

OLIVER Says:

advair@copd.advertising.campaign” rel=”nofollow”>..

Buynow…

MELVIN Says:

aldactone@kidney.problems” rel=”nofollow”>…

Buygeneric drugs…

DAN Says:

buy@amoxicillin.500mg” rel=”nofollow”>.

Buynow it…

BARRY Says:

risperdal@vs.abilify” rel=”nofollow”>.

Buygeneric drugs…

STEPHEN Says:

accutane@verdict.buy” rel=”nofollow”>..

Buydrugs without prescription…

CLINTON Says:

actonel@and.dvt” rel=”nofollow”>.

Buygeneric meds…

DOUGLAS Says:

adalat@asus.buy” rel=”nofollow”>.

Buydrugs without prescription…

RICHARD Says:

allegra@generic.purchase” rel=”nofollow”>…

Buynow…

STEPHEN Says:

allopurinol@atrial.fibrillation” rel=”nofollow”>.

Buygeneric pills…

FERNANDO Says:

arimidex@or.nolvadex.steriods” rel=”nofollow”>..

Buywithout prescription…

OLIVER Says:

artane@bending.over” rel=”nofollow”>.

Buynow…

gerard Says:

Search music now US Charts…

EVERETT Says:

levaquin 500mg

Buy_no prescription…

JERRY Says:

norvasc and theophylline

Buy_drugs without prescription…

RAY Says:

birth control pills for pms symptoms

Buy_drugs without prescription…

GREG Says:

aspirin pain relief dog

Buy_drugs without prescription…

TODD Says:

heart worm medication

Buy_no prescription…

STUART Says:

viagra in the uk

Buy_no prescription…

CHRIS Says:

rapid weight loss

Buy_generic drugs…

FREDERICK Says:

good and bad drugs

Buy_without prescription…

DAN Says:

drug trafficking in latin america

Buy_drugs without prescription…

ANDREW Says:

iv zofran

Buy_drugs without prescription…

WADE Says:

planar warts

Buy_drugs without prescription…

HOMER Says:

dhea treatment of depression

Buy_drugs without prescription…

KENNY Says:

enhancement drugs

Buy_no prescription…

TERRENCE Says:

drug test company

Buy_without prescription…

KYLE Says:

stop smoking phlegm

Buy_drugs without prescription…

BYRON Says:

what foods anorexia eat

Buy_drugs without prescription…

FREDRICK Says:

colon cancer lymph node

Buy_without prescription…

JEFFERY Says:

depression medcine xr

Buy_drugs without prescription…

RAMON Says:

seed implant for prostate cancer

Buy_drugs without prescription…

FRANCIS Says:

adult male wheezing new onset

Buy_drugs without prescription…

FRED Says:

terry abbot

Buy_generic drugs…

JIM Says:

children during the depression

Buy_drugs without prescription…

JOHN Says:

canadian@pharmacy.valtrex” rel=”nofollow”>…

Buygeneric meds…

BRETT Says:

indications@for.use.of.atrovent” rel=”nofollow”>…

Buygeneric meds…

JEREMY Says:

best@medicare.plan.d.for.nexium.40.mg” rel=”nofollow”>..

Buygeneric meds…

HARRY Says:

infant@prevacid.dose” rel=”nofollow”>.

Buygeneric drugs…

Leave a Reply