dongsong4418 2017-05-01 23:13
浏览 38
已采纳

在新的GIT分支中安装Laravel会将master文件夹留在master中

I am starting a fresh build of an existing non-Laravel project so I've created an orphan branch off my master, removed existing files and installed Laravel.

The problem is that when I switch back to my master branch, the vendor and storage directories (and files) persist in my local master branch, and are showing up as ready to be staged and committed.

I was under the assumption that any files, folders, etc that are created in the new branch, would not exists when switching branches.

enter image description here

  • 写回答

1条回答 默认 最新

  • douxiuar885064 2017-05-02 05:04
    关注

    The vendor directory is in the .gitignore in your fresh branch, so those files are not tracked by git. They are not added to the repo, and do not wish to be.

    When you switch branches, git is not going to touch any files for which it is not tracking. So, when you switch to master, it will not delete the vendor files, as git is not tracking them.

    Now when you're on master, your .gitignore in master probably does not ignore the vendor directory, so your master branch sees those files as new files ready to be checked in. Add the vendor directory to the .gitignore in your master branch, and they'll stop pestering you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请提供一个符合要求的网页链接。
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码