.gitignore use git ignore file upload related documents

When using git, you do not need to upload some files to the repository, such as the idea / eclipse-related files, compiled files (target directory) and so on.

You can use .gitignore file configuration. Create a file in git .gitignore local repository.

 

#maven
target/
#IDEA .idea
/ *.iml

#eclipse
.settings/
.metadata/
.classpath
.project
Services/

#: Notes row

Ignore all files in a directory aa: aa /

bb: bb Ignore file

* .A: Ignore ending .a file

! Cc.txt: In addition to cc.txt file

If the item has been uploaded, cached locally, will result in the above configuration is invalid, the file will still be uploaded.

Therefore, the local cache needs to be cleared before uploading. Then push.

# Clear local cache 
git RM -r --cached.

 

Guess you like

Origin www.cnblogs.com/lgjlife/p/10929897.html