我怎样才能 select 不应该被拉到存储库的文件?
How can I select the files that should never be pulled to the repository?
如何 select 永远不应将文件拉入存储库?
特别是我希望此文件 myBackend/src/main/resources/application.properties
永不同步,因为每个用户都将本地设置放在存储在 develop
分支中的模板 application.properties
之上。
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
modified: myBackend/docker-compose.yml
modified: myBackend/src/main/resources/application.properties
Untracked files:
(use "git add <file>..." to include in what will be committed)
myBackend/udo systemctl start docker
no changes added to commit (use "git add" and/or "git commit -a")
此外,我还有一些奇怪的未跟踪文件myBackend/udo systemctl start docker
。事实上,这不是文件。这是一条错误的命令 udo
而不是 sudo
.
如何删除它?
要删除本地未跟踪的文件,git clean
是你的不二之选。
第一个运行:
git clean -n //This will display the untracked files that will be removed
然后运行:
git clean -f //To remove the file(s) - Note: Remove here means Delete
如果它是目录,请改为执行此操作:
git clean -fd
最后,要忽略文件,只需将它们添加到您的 .gitignore
文件
所以,在你的情况下,
Add myBackend/src/main/resources/application.properties to your .gitignore file.
如何 select 永远不应将文件拉入存储库?
特别是我希望此文件 myBackend/src/main/resources/application.properties
永不同步,因为每个用户都将本地设置放在存储在 develop
分支中的模板 application.properties
之上。
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
modified: myBackend/docker-compose.yml
modified: myBackend/src/main/resources/application.properties
Untracked files:
(use "git add <file>..." to include in what will be committed)
myBackend/udo systemctl start docker
no changes added to commit (use "git add" and/or "git commit -a")
此外,我还有一些奇怪的未跟踪文件myBackend/udo systemctl start docker
。事实上,这不是文件。这是一条错误的命令 udo
而不是 sudo
.
如何删除它?
要删除本地未跟踪的文件,git clean
是你的不二之选。
第一个运行:
git clean -n //This will display the untracked files that will be removed
然后运行:
git clean -f //To remove the file(s) - Note: Remove here means Delete
如果它是目录,请改为执行此操作:
git clean -fd
最后,要忽略文件,只需将它们添加到您的 .gitignore
文件
所以,在你的情况下,
Add myBackend/src/main/resources/application.properties to your .gitignore file.