0

I added a subfolder to house my built project on Github. Call the folder /BuiltProject. For some reason when I run git status I cannot see this file:

BuiltProject/my.exe.

How can I checkin my built project?

gitignore:

bin/
TestProject
/Sample.pro
*.vshost.*
ProjectName/app.config
/ProjectName.exe.config
P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348

3 Answers3

1

I ran git status --ignored and saw my file being ignored. I ran

git add -f BuiltProject/my.exe

And now it can be committed. I don't know why the file is ignored, but I guess this will bypass that.

P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
1

So apparently, some configuration tells git to ignore your BuiltProject/my.exe file.

In spite of this, you could add the file to the index by doing

git add --force BuiltProject/my.exe && git commit -m "adding binary"

If you want to know who is responsible for ignoring the file, there's git check-ignore:

git check-ignore -v BuiltProject/my.exe

It will tell you the ignore file and the ignore pattern that leads to ignoring your file.

However, IMHO it's not common to include resulting binaries in source control. Either use GitHub's Release feature for uploading binaries attached to a label or set up a second repo that just holds the binaries where customers could download binaries of your software if people aren't interested in the sources.

Related reading:

Community
  • 1
  • 1
eckes
  • 64,417
  • 29
  • 168
  • 201
0

Maybe it's worth checking the following files for *.exe ignoring rule:

$HOME/.config/git/ignore
$GIT_DIR/info/exclude
Vitalliuss
  • 1,614
  • 1
  • 12
  • 10