Telling git to ignore files that end with ~ in ubuntu

I am not sure if this is ubuntu specific as I just switched from windows. Please let me know if I should ask this elsewhere.

I am using version control for some local repositories. Some of the files have a ~ at the end and I don't need these files. For example, I have test.m and test.m~ simultaneously. Other text files have the same issue too.

I want to include ALL files that end with ~ in .gitignore but I am unsure how to proceed.

1 Answer

a line with *~ in your .gitignore file should do it. Here is an example from the default .gitignore file for my yelp-tools git clone:

$ cat /home/doug/temp-yelp-git/yelp-tools/.gitignore
*~
INSTALL
Makefile
Makefile.in
/aclocal.m4
/autom4te.cache
/ChangeLog
/config.guess
/config.log
/config.status
/config.sub
/configure
/install-sh
/intltool-extract.in
/intltool-merge.in
/intltool-update.in
/missing
/tools/yelp-build
/tools/yelp-check
/tools/yelp-new
/xslt/mal-ncx.xsl
/xslt/mal-opf.xsl

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like