I want only to add source file, not exe or object file in GitHub.
What should I do?
Can I use git add -a or others to add only all source file without adding exe or object file?
I want only to add source file, not exe or object file in GitHub.
What should I do?
Can I use git add -a or others to add only all source file without adding exe or object file?
Note: git add -a does not exists. git add -A does.
And you don't need to use explicitly this -A option, since it is the default when you specify the current path:
cd /path/to/my/repo
git add .
All you need is a .gitignore file, as one of gitignore.io or github/gitignore.
You can test it with a git status: if you see a file.exe, that means the .gitignore is not present, or does not include an *.exe directive.
As soon as the .gitignore is there (even it is has not been added/committed itself), the git status will reflect its directives.