Git Part 3 gitignore


This entry is part 3 of 5 in the series Git and GitHub

This post is about protecting your privacy in Github. These files or folders might contain sensitive information like passwords, invoices or work plans. To do this we create a brand new file called .gitignore. That’s dot gitignore. It is just a text file. We create this text file and type in the list of folders and files that we want to protect.

Suppose you have a folder called private and a file called webpasswords.txt and you want to protect these from prying eyes. Your .gitignore file will look something like the following. Directories (folders) are preceded by a slash.

/private
webpasswords.txt

If you are working on a Windows Presentation Foundation (WPF) project you could try the following gitignore sample. You can create the gitignore file in Windows with Git Bash. You can start Git Bash in the folder and then at the command line you can run touch gitignore.

Series Navigation<< Git Part 2 Add Commit Branch Delete RevertGitHub Introduction >>