Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git pull from another users working directory

Is it possible to pull specific files or changes from another users working directory using thier Local IP address?

e.g.

git pull http://192.168.1.101/sandbox/somefile.php

It should be noted that both users are using Windows XP.

Thanks,

P.

like image 652
paperclip Avatar asked Dec 10 '22 11:12

paperclip


2 Answers

Thanks to the response of both Rup's answer and eckes's answer, I've come up with the following so far:

You'll need to know the IP address of the users PC 192.168.x.x (this will be the in the example below) and then you'll need to share the folder in Windows XP.

  1. Right-click the desired folder you want to share on the users PC and select Properties.
  2. Select the Sharing tab.
  3. Select 'Share this folder' and give the folder a name. This will be the in the example below.
  4. Click OK.

On your PC you need to have an initialised and empty git repository for you to add the new remote before you pull.

Example:

git init
git remote add <alias> //<ip_address>/<shared_folder_name>
git pull <alias> <branch>

The problem with the above is that it will copy the entire contents of the shared folder. I am still looking for a way to pull an individial file from another users working directory.

like image 54
paperclip Avatar answered Dec 19 '22 03:12

paperclip


Yes, although it'll depend on what file sharing mechanisms you have. Your other user almost certainly won't be hosting their repository over HTTP by default, although you could have them set this up if you want. What you probably want to do is use XP's file sharing which you can do via IP, i.e.

git pull \\192.168.1.101\shared_directory\sandbox

if there's shared directory set up or

git pull \\192.168.1.101\c$\full_path_on_c_drive\sandbox

if there's no shared directory but you have sufficient access rights to their machine.

like image 23
Rup Avatar answered Dec 19 '22 04:12

Rup