Git-secret: Add File does not add to GitIgnore (per docs)

Created on 27 Jun 2018  Â·  8Comments  Â·  Source: sobolevn/git-secret

What are the steps to reproduce this issue?

  1. create a secret file
  2. git secret add

What happens?

git-secret: abort: these files are not in .gitignore: <filename>

What were you expecting to happen?

It would be automagically added to .gitignore, as per the docs.

The docs say:

$ git secret
...
 add [filename.txt] - adds file to be hidden. Also add this file to .gitignore

It says:

Also add this file to .gitignore

Any logs, error output, etc?

git-secret: abort: these files are not in .gitignore: <filename>

Any other comments?

What versions of software are you using?

Operating system: (uname -a) …
Darwin 1734021-C02T94WHGTFM 16.7.0 Darwin Kernel Version 16.7.0: Fri Apr 27 17:59:46 PDT 2018; root:xnu-3789.73.13~1/RELEASE_X86_64 x86_64 i386 MacBookPro13,3 Darwin

git-secret path: (which git-secret) …
/usr/local/bin/git-secret

git-secret version: (git secret --version) …
0.2.4

git version: (git --version) …
git version 2.17.0

Shell type and version: ($SHELL --version) …
GNU bash, version 4.4.19(1)-release (x86_64-apple-darwin16.7.0)

gpg version: (gpg --version) …
gpg (GnuPG) 2.2.8
libgcrypt 1.8.3

Most helpful comment

Yeap, that should be a default behavior starting from v0.3.

All 8 comments

Hello, @eduncan911

To auto-add the filename to .gitignore, you have to use the -i flag for git secret add filename, as documented at http://git-secret.io/git-secret-add (see also git secret add -h)

I just tested it and it seems to work for me. Sounds like this is a documentation issue?

How about we change the text in the git-secret --help output from:
add [filename.txt] - adds file to be hidden. Also add this file to .gitignore
to
add [filename.txt] - adds file to be hidden. Can also add file to .gitignore

ah, i never saw the -i listed anywhere. never knew this existed!

how about this:
```
add [filename.txt] - adds file to be hidden. Can also add file to .gitignore with -i option

however, i think for newcomers, defaulting to -i makes this much easier?

Yeap, that should be a default behavior starting from v0.3.

This is fixed in PR #222

Should we start a list somewhere of changes that we're scheduling for v0.3.0?

We can create a milestone for this version and add related issues.
Or a project if you prefer agile-like boards.

is it just me, or is there no link to this hidden page on the main website?

http://git-secret.io/git-secret-add (as linked to above)

@eduncan911 are you talking about this link?

2018-07-02 22 56 58

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshrabinowitz picture joshrabinowitz  Â·  4Comments

f-liva picture f-liva  Â·  4Comments

elmarsto picture elmarsto  Â·  4Comments

notjames picture notjames  Â·  6Comments

barak picture barak  Â·  6Comments