Re: Basic Git Questions
- From
- George Spelvin <linux@horizon.com>
- Date
- Dec 20, 2010, 19:21 UTC
- Message-ID
- <20101220192152.4509.qmail@science.horizon.com>
> 1. I generally add the files in my working directory using "git add > .". But sometimes you want to add all the files except 1 or 2 file. Is > there a shortcut way we can tell git to add all the files but exclude > a particular file.
Others have pointed out the general techniques, but a few additional things that may be useful in some situations:
1) .gitignore. If the files are such that you never want git to pay attention to them, you can add them to the .gitignore file. 2) "git add -u". This adds only files that git is already tracking, and ignores truly new files. 3) "git add -i". This lets you pick the files to be added from a list. 4) "git gui". This lets you click on the files to be added. It's my preferred way to do a selective commit.