Tuesday, February 3, 2015

syncing git repo when the remote repo is not a bare repo

GIT tip

On the server create a git repo

mkdir GitRepo
cd GitRepo
git init work.git

$ pwd
/pa/ns/r/rprajapa/GitRepo/work.git


On the client windows box.. install git .. While installing choose the option where it recognizes the Putty PLINK

using the GUI : select "Clone Existing Repository"
Enter the Target directory 

URL for existing repo of server : rprajapa@abc.xyz.org:/pa/ns/r/rprajapa/GitRepo/work.git
Choose any Target directory


Now you have cloned the repo and can work on it locally.
When its time to sync back to Server repo.. since its not a bare repo we will have to ftp the local repo
files including the .git directory to the server
say at location below:

$ ls -atlr /pa/ns/r/rprajapa/git_to_pull_from/
total 24
drwx------  28 rprajapa  pa  3072 Feb  3 23:38 ..
drwxr-xr-x   4 rprajapa  pa  2560 Feb  3 23:39 work.git
drwxr-xr-x   4 rprajapa  pa   512 Feb  3 23:43 .
drwxr-xr-x   7 rprajapa  pa   512 Feb  3 23:44 .git
$

Now go to the origin repo

$ pwd
/pa/ns/r/rprajapa/GitRepo/work.git

Enter the pull command to pull 

git pull file:///pa/ns/r/rprajapa/git_to_pull_from/



No comments:

Post a Comment

Followers

About Me

Torrance, CA, United States