Adding Git Ignore File
A Git ignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected.
Git ignore is a convention in git. Setting a file by the name of .gitignore will ignore the files in that directory and deeper directories that match the patterns that the file contains. The most common use is just to have one file like this at the top level. But you can add others deeper in your directory structure to ignore even more patterns or stop ignoring them for that directory and subsequently deeper ones.
How to setup .gitignore file on git:
1. Create a .gitignore file with all patterns that you would like to ignore, such as :
.DS_Store
.gradle
*.eml
*.iml
.idea
*.war
xcuserdata
project.xcworkspace
build
CompiledOutput
Frameworks
target
.metadata
archives
.classpath
.project
.settings
bin
*.log
log.*
You can create a normal .txt file and rename it on .gitignore or you Can also download a .gitignore file for this link:
Downlaod a Sample .gitignore file
2. Once you have this, you need to add it to your git repository. You have to save the file where your repository is so copy .gitignore file into your project root directory.
3. Add .gitignore file and commit and push code to GitHub.
You Can add Common things in gitingnore file so that they ate not committed or tracked again and again, such as project setting, framework, xcuserdata, project.xcworkspace and other.
No comments:
Post a Comment