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 写uniapp时遇到的问题
  • ¥15 matlab有限元法求解梁带有若干弹簧质量系统的固有频率
  • ¥15 找一个网络防御专家,外包的
  • ¥100 能不能让两张不同的图片md5值一样,(有尝)
  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码
  • ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
  • ¥20 MATLAB绘制两隐函数曲面的交线
  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流