添加所有非受控文件?
我使用 phpstorm 作为我的 IDE,它内置了 git 版本控制集成,所以我从来不需要使用命令行。
然而我遇到了一个问题,有几次当我被提示“你想添加这个文件/目录到 git 版本控制吗”时,我点击了“否”,因此我到处都有一些不存在的文件夹和文件控制之下。
我想知道是否有一个命令可以运行来将所有这些文件添加到版本控制中?
I use phpstorm as my IDE, it has git version control integration built in so I have never needed to use the command line.
However I have run into a problem, a few times when I have been prompted "Do you wish to add this file/directory to git version control" I have clicked no, Hence I have some folders and files all over the place that are not under the control.
I am wondering if there is a command I can run that will add all these files to the version control for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 PhpStorm 中,您可以打开更改面板,在本地选项卡中,您将在单独的节点下看到所有未版本控制的文件。您可以右键单击该节点或选择单个文件,然后将它们立即添加到版本控制中。然后在准备好后执行提交/推送。
In PhpStorm you can open the Changes panel and in the Local tab you will see all the Unversioned files under the separate node. You can right click on this node or select individual files and then add them to version control at once. Then perform commit/push when ready.
进入命令行并将工作目录更改为 git 存储库。
将所有内容暂存到工作目录和子目录中
下次提交时,尚未进行
.gitignore
处理的所有内容都将添加到版本控制中。注意:
git add .
还将暂存任何已受版本控制的文件。如果自上次提交以来您对任何文件进行了更改,您可能希望避免提交它们。如果是这样,请先隐藏您的更改:Get to a command line and change your working directory to your git repository.
Stage everything in the working directory and subdirectories
The next time you commit, everything that has not been
.gitignore
'd will be added to version control.NB:
git add .
will also stage any files that are already version controlled. If you've made changes to any files since your last commit, you may want to avoid committing them. If so, stash your changes first: