I have a git repo which contains an AngularJS web app.
It has a subfolder called build
, which gets created by a gulp task. I am deploying to Azure, so
While the documentation on this is extensive [https://git-scm.com/book/en/v2/Git-Tools-Submodules], I found the solution was to understand how submodules work. This is a simplified plain english version.
$ git innit
) you may be getting an error if you have added another initialised repo as a submodule$rm -rf git
) this force removes the files tracked by git - or before you add it to the repo remove the initialisation$ git diff / $ git diff --cached / $ git diff - - submodule
if you have cached files the documentation runs you through what to do $ git checkout -b stable (create a new branch called stable)
$ git checkout stable (check into the new branch)
$ cd .. (into your branch with the submodules)
$ git submodule update --remote --merge (update and merge the submodule to the remote branch)
$ git add . (add all files and directories to the branch)
$ git commit -m”adds submodule to new branch” (commit changes in the branch)
$ git push (push changes in the branch) - this will remind you make the stable branch your upstream
$ git push --set-upstream origin stable (set upstream to your new branch)
$ git checkout master (checkout into the master branch)
$ git merge stable (merge pushed changes from branch to master)
$ git add .
$ git commit -m”adds submodules from merged stable branch”
$ git push origin master