0

My project consists of two main folders, /client and /server. .git forlder is top-level:

/app
  |-- /.git
  |-- /client
  |-- /server

And I have three branches

master
redux
prod

On redux branch I’m migrating an app to Redux.

On master branch there is current version of an app. Actually dev version.

I usually work on master and do these commands to update my local/remote repos. It updates both, /server and /client:

git push origin master
git fetch origin master
git merge origin master

As I’m working on redux branch and Redux migration, it's hugely not the same with current /client folder in /master.

The question is, how to fetch updates from master branch from /server folder only?

1) I'm on redux branch. Working in /client folder.

2) I push to redux branch.

3) But I need fetch from master branch from /server folder.

Is it possible?

Green
  • 28,742
  • 61
  • 158
  • 247
  • 1
    Possible duplicate of [How to pull specific directory with git](https://stackoverflow.com/questions/2425059/how-to-pull-specific-directory-with-git) –  May 22 '18 at 08:33

1 Answers1

1

It doesn't seem possible to git fetch a specific directory. It only works for entire repositories. For reference, please check the Git Fetch documentation.

Alternatively, you might want to instead git pull a specific directory from the current repo? In this case, you can have a look at the answer to this question.

Ivan Petkov
  • 141
  • 6