# Re: Basic Git Questions

2 messages from 2010-12-20 to 2010-12-21. Participants: George Spelvin, Adam Kellas.
Thread: https://gitlist.dev/t/26112

## George Spelvin, 2010-12-20 19:21

Subject: Re: Basic Git Questions
Message-ID: <20101220192152.4509.qmail@science.horizon.com>
URL: https://gitlist.dev/e/20101220192152.4509.qmail%40science.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.

```

## Adam Kellas, 2010-12-21 02:59

Subject: Re: Basic Git Questions
Message-ID: <iep54u$tqp$1@dough.gmane.org>
URL: https://gitlist.dev/e/iep54u%24tqp%241%40dough.gmane.org
In-Reply-To: <20101220192152.4509.qmail@science.horizon.com>

```
On 12/20/2010 2:21 PM, George Spelvin wrote:
> 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.

My own preferred pattern is to flip the default: I put a '*' in 
.gitignore and use "add -f" when I want files tracked.

AK

```
