Re: Git commit won't add an untracked file given on the command line
Le Tuesday 18 November 2008 22:12:37 Mark Burton, vous avez écrit :
Show 12 quoted lines
> Hi,
>
> When I try:
>
> git commit -m "New file." .gitignore
>
> Where .gitignore is not yet tracked, I get:
>
> error: pathspec '.gitignore' did not match any file(s) known to git.
>
> Is that result by design, sloth or bug (or me being stupid)?
>
You must "git add .gitignore" first. And yes, this is by design.
You could also have done git commit -a -m "themessage".
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 6 83 87 78 75
Tel : +33 (0) 1 78 94 55 52
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris