0

I am trying to call git fetch in subfolder while using Windows CMD like this

D:>C:\Git\cmd\git.exe fetch path\to\subfolder

Then I get error: fatal: Not a git repository (or any of the parent directories): .git

But when I am in my repository folder everything works fine:

D:\path\to\subfolder>C:\Git\cmd\git.exe fetch

What am I doing wrong? Can I call git functions in Windows subfolders via CMD?

Sarpens
  • 298
  • 3
  • 9
  • possible duplicate of [git --git-dir not working as expected](http://stackoverflow.com/questions/1386291/git-git-dir-not-working-as-expected) – John Zwinck Oct 15 '14 at 12:53

1 Answers1

1

I don't think git fetch can be used to fetch only the changed files in a sub directory. git fetch is normally used to fetch the latest changes from the remote repository and is used like below.

git fetch <remote_name> <branch_name>

I think What you are doing wrong is providing the sub directory path after "git fetch". I tried the same and got the below error

ajbose@L-BLR-00800896 /c/Code/biz/bizdatacollectnodeweb/test (develop)
$ git fetch unit
fatal: 'unit' does not appear to be a git repository
fatal: Could not read from remote repository.

I hope this helps.

Ajay
  • 2,976
  • 2
  • 28
  • 35