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?

1

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.