S
S
sergeyfilkin2014-01-07 12:30:53
git
sergeyfilkin, 2014-01-07 12:30:53

How can you keep the repository on a virtual machine, and edit the files on Windows so that the file permissions do not change?

My OS is Windows 7, and for development I use a Virtualbox virtual machine with Ubuntu 12.04. There is a Git repository on the virtual HDD, the files in which I would like to edit from Windows.
I set up a shared folder from the Virtualbox interface, but only the folder on the host is rummaged with this method, and NTFS does not support UNIX permissions. I copied the repository to the shared folder, and now `git status` on Ubuntu shows a lot of changed files (only the permissions have changed). I can set the git `git config core.fileMode false` setting, but that's not exactly what I need.
Question for the audience: how can you keep the repository on a virtual machine, and edit files on Windows so that the file permissions do not change?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
O
Oleg, 2014-01-07
@sergeyfilkin

Samba will solve your problem. I use this method myself. Through the network folder, the rights do not change.

R
romanmd86, 2014-01-07
@romanmd86

Vstav'te i host i guest v odnom LAN - Host-only adapter. After - samba or nfs.

S
silentvick, 2014-01-07
@silentvick

I doubt it's possible. It seems to me that it would be easier and more correct to write a small script (shell or means of the language / framework / etc.) that sets the rights "as it should" and put it in the repository.

A
Alexey Kiselev, 2014-01-09
@alexeykiselev

Git is a distributed version control system, you don't need to use it like SVN. Clone repositories as needed, it's easy and can be done locally.
Create a Git repository in the bare shared folder:

mkdir repo
cd repo
git init --bare

On Ubuntu, add a link to the newly created shared repository to the repository and push the existing commits into it.
git remote add origin [путь к папке разделяемого репозитория]
git push origin master #отправляем ветку master в удаленный репозиторий по ссылке origin

Now let's clone the shared repository on Windows.
and work in copy. Changes are sent and received with push and pull commands.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question