I am trying below git command referring to this documentation https://git-scm.com/docs/git.
It works fine if I use stash
instead stash -a
in below git command, else it shows error message mentioned below. Can anyone help me with the alternatives to make it work per my need?
My requirement is to stash all files including untracked (if any) before I want to take a git pull, I have multiple projects, for which I want to automate this task because for each project repeating git stash -a
, then git pull origin master-ci
is the headache, somehow I want to automate this in git-pull-latest.bat
script.
Git command tried:
set MY_REPO=C:\Users\ravibeli\Documents\Projects\GitRepo
set MY_GIT_OPERATION=pull origin master-ci
git --git-dir=%MY_REPO%\demo-service\.git --work-tree=%MY_REPO% stash -a && git --git-dir=%MY_REPO%\demo-service\.git --work-tree=%MY_REPO% %MY_GIT_OPERATION%
Error message:
Ignoring path demo-service/
Saved working directory and index state WIP on poc-branch: 9f625aa18 Merge pull request #1004 in demo-service from ~ravibeli/demo-service:display-message to poc-branch