![]() ![]() Nothing to commit, working directory clean Checkout master branch Your branch is up-to-date with 'origin/develop'. If there were truly untracked files, running a git status would reveal them, but there aren’t any: # git status You removed the wp-content/plugins/akismet directoryĪt this point, we’re on the develop branch and trying to checkout the master branch, but we’re greeted with this error: # git checkout masterĮrror: The following untracked working tree files would be overwritten by checkout:įor some reason, Git doesn’t recognize that those files have already been added and committed within the akismet submodule, so it’s aborting the checkout to prevent them from being overwritten.Let me setup the problem for you, in detail, using an example: That said, let’s look at the problem in detail and how we can solve it. Git complains with the following error: error: The following untracked working tree files would be overwritten by checkout The main problem is that I’m unable to checkout the master branch after adding the submodules on the develop branch. Luckily, it’s nothing severe, and in my case, pretty straight forward to fix (once you know the solution), but because the error didn’t make any sense, I’ve decided to document it here. While many recommend staying away from submodules all together, I’ve been using them for a while now and never had any issues, that is, until today. Part of each site’s update includes converting the WordPress core and all frequently used plugins to Git submodules. I’m working on updating several WordPress sites. 6 min read Do birds experience errors when they switch branches?. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |