Git pull from another working directory users

Can I pull certain files or changes from another users working directory using my local IP address?

eg.

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

It should be noted that both users use Windows XP.

Thanks,

R.

+4
source share
3 answers

Thanks to both the Rup answer and the eckes answer, I came up with the following:

You need to know the IP address of the users PC 192.168.xx (this will be in the example below), and then you will need to open the folder in Windows XP.

  • Right-click the desired folder that you want to provide to users' PCs and select "Properties."
  • Select the Sharing tab.
  • Select Share This Folder and give the folder a name. This will be in the example below.
  • Click OK.

On your PC, you need to have an initialized and empty git repository so you can add a new remote before pulling.

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'm still looking for a way to pull a single file from another users working directory.

+7
source

Yes, although it will depend on what kind of file sharing mechanisms you have. Your other user will almost certainly not host their repository over HTTP by default, although you could configure them if you want. What you probably want to do is use XP file sharing, which you can do over IP, i.e.

 git pull \\192.168.1.101\shared_directory\sandbox 

if a shared directory is installed or

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

if there is no shared directory, but you have sufficient access rights to their machine.

+3
source

As an alternative to Rup answer, you can access windows domain windows using

 git pull //hostname.domain/share/to/repo 

where repo is the folder containing the .git directory. When you pull out the extracted working copy, you cannot push your changes back to the repo until another branch is selected on repo as the one you want to push.

So, if you pulled out and want to make changes back to the master branch, you won’t be able to push until another branch is checked out at hostname.domain/share/to/repo . One workflow must have an unused branch (for example, called unused_branch ) and check this branch for hostname.domain before you push change your changes.

A cleaner alternative is to have a bare repo on the computer that you and other users have access to. In this case, you can push not to check another branch before, since bare repositories do not have a valid working copy.

+3
source

Source: https://habr.com/ru/post/1334339/


All Articles