Create a .gitignore
From the Github specs...
The purpose of gitignore files is to ensure that certain files not tracked by git remain untracked.
Create a .gitignore file all your own:
These steps use vim to update the .gitignore file
- Navigate to the folder that contains the files for your project.
- If you have not yet created a .git file, run the
git commit
command. - Create a .gitignore file by running
touch .gitignore
. The file name ".gitignore" is case sensitive and the name of the file matters. Git will look for a file with that name and will not stage (add) or commit files that is is told to ignore. - Use vim to open the file by running
vim .gitignore
. This will open a text editor called "Vim" inside your console. - Press the escape key to enter and exit text-entry mode.
- Once you have updated your .gitignore files you can save and exit vim by pressing
escape
, entering:wq
, and pressingreturn/enter
Example:
# Don't track content of these folders
node_modules/
someOtherfoler/
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
No comments:
Post a Comment