将不想提交的文件写入到.gitgnore文件中。记得要把.gitignore也添加进来
主要步骤:
1. git status 列出当前目录所有还没有被git管理的文件和被git管理且被修改但还未提交(git commit)的文件.
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
/target/
zblog.iml
nothing added to commit but untracked files present (use "git add" to track)
2.将要忽略的文件写入到.gitignore
vim .gitignore
追加如下内容(根据自己的提示添加)
/target/
zblog.iml
PS:注意实际路径可以用*模糊操作
想提交文件
- git status 列出当前目录所有还没有被git管理的文件和被git管理且被修改但还未提交(git commit)的文件.
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
/target/
zblog.iml
nothing added to commit but untracked files present (use "git add" to track)
2.将这些文件或文件夹add进去
git add /target/.
git add zblog.iml
--------------------- 本文来自 eumji 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/jsu_9207/article/details/70138924?utm_source=copy
网友评论