0

In one of git scenario, I have same not commit file on local system which is available on git Server as well. Now situation is, I haven't add these local system file and after stashing when I'm trying to pull master it prompt error to delete these local files.

Any suggestion how to fix this.

CoDe
  • 11,056
  • 14
  • 90
  • 197

1 Answers1

0

Let's assume that you on your develop branch and your desired local file is experimental.local.file.txt. In this case you can use this scheme:

  1. Create experimental branch git checkout -b experimental
  2. Add this local file to git git add experimental.local.file.txt
  3. Commit it git commit -m 'Add experimental file'
  4. Get remote branch (i.e origin/develop) and merge it with this experimental one git pull ./ origin/develop
  5. Resolve conflicts and commit it
  6. Checkout back to develop with command git checkout develop
  7. Now you can just merge your develop branch with origin/develop with command git pull. There are no more experimental.local.file.txt in your local branch, so your can pull without errors.
  8. Then checkout your experimental.local.file.txt file from experimental branch with command below:
  9. git checkout experimental path/to/experimental.local.file.txt
alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46