Skip to content

Instantly share code, notes, and snippets.

@iagopiimenta
Created July 17, 2014 15:08
Show Gist options
  • Save iagopiimenta/77baa975ac3c36fca990 to your computer and use it in GitHub Desktop.
Save iagopiimenta/77baa975ac3c36fca990 to your computer and use it in GitHub Desktop.
How add or change a file but is ignored by git
git init
touch test.php
git add test.php
git commit -m "initial commit"
# any command or script to add or change a file but is ignored by git
# example: add debug.php and alter file -> echo -n "testing..." >> test.php
any-command-to-edit-or-create-patch-files
ls
-> test.php debug.php
# Now git status to ignore the added and changed files.
git status
-> nothing to commit (working directory clean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment