botWerks

archive for the ‘git’ tag

notes for setting up a remote git repo (ssh transport)

on the main server create the directory and initialize a bare repo on the server.

% mkdir path_to_repo
% cd path_to_repo
% git --bare init

from the local machine with your content/code, add the remote origin and push your code to the repo.

% cd path_to_local_source
% git remote add origin ssh://hostname/path_to_repo
% git push origin master

share it or get it from another location …

% git clone ssh://hostname/path_to_repo

assumes that the person has an account on the host with the appropriate permissions to modify or read the repo contents.

pull changes from the server to pick up the latest …

% git pull origin master

written by sulrich

January 3rd, 2010 at 12:44 am

posted in nerd

tagged with ,