I have a directory:
a
b
c
I did git init
to create repistory. But I want my repository to only contain
a
b
No matter what else gets added. Is that the proper workflow?
I have a directory:
a
b
c
I did git init
to create repistory. But I want my repository to only contain
a
b
No matter what else gets added. Is that the proper workflow?
Add a .gitignore
file to your repo which contains glob style patters of what you do not want to be tracked by git. For example in one of my GO repos I have:
23:10 $ cat .gitignore
*/**/*.a
*/**/telemetry
In your case it would simply be:
$ cat .gitignore
c
Hope this helps
If you want to ignore everything except a and b, your .gitignore should contain:
# Ignore everything
*
# But not these files...
!.gitignore
!a
!b
remark that you should add gitigore also to your repository :)