← Back to team overview

zim-wiki team mailing list archive

Re: Version control plugin issue with git under windows

 

Hi Jaap,

"git add ." works fine even in a bigger repository, if the cwd is set to the directory where the zim notebook is stored (in the following example subdir):

C:\>mkdir zimtest
C:\>cd zimtest
C:\zimtest>git init
Initialized empty Git repository in C:/zimtest/.git/
C:\zimtest>mkdir subdir
C:\zimtest>touch file1
C:\zimtest>touch subdir\file2
C:\zimtest>cd subdir
C:\zimtest\subdir>git add .
C:\zimtest\subdir>cd ..
C:\zimtest>git status
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

        new file:   subdir/file2

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        file1


Specifiying the path doesn't work (at least under windows):

C:\zimtest>git add c:\zimtest\subdir
fatal: c:\zimtest\subdir: 'c:\zimtest\subdir' is outside repository
C:\zimtest>cd \
C:\>git add c:\zimtest\subdir
fatal: Not a git repository (or any of the parent directories): .git

Ciao,
  Steffen

Am 24.10.2015 um 20:38 schrieb Jaap Karssenberg:
Hi Steffen,

The reason this change was made is that a number of users have their
notebook as part of a larger git repository. By adding the folder we
prevent making changes to the git repository outside of the notebook
folder. This is the correct thing to do.

Question is why it fails in your setup. Does the folder show up
correctly in the command?  And if so, are there maybe special characters
in the folder name (like umlaut, accent, ...).

Regards,

Jaap



On Fri, Oct 23, 2015 at 9:59 PM, Steffen Siebert
<steffen.siebert@xxxxxxxxx <mailto:steffen.siebert@xxxxxxxxx>> wrote:

    Starting from Zim 0.62 the version control plugin can't
    automatically save changes using git at least under windows (didn't
    try linux).

    The offending change seems to be that instead of "git add ." now
    "git add <dir>" (where <dir> is the value of self.notebook_dir) is
    executed, but git refuses to do so.

    I don't know why this change was made, but please revert it if possible.

    I tried to update to latest git for windows (2.6.1) but it made no
    difference.

    Ciao,
       Steffen

    _______________________________________________
    Mailing list: https://launchpad.net/~zim-wiki
    Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
    <mailto:zim-wiki@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~zim-wiki
    More help   : https://help.launchpad.net/ListHelp





References