0

Im trying to create a new repo of my c# project and i would like to push the Debug folder contents as well but i would like it to load all the files inside apart from the .local-chromium folder and what's inside it, nothing more, I took the c # template from the gitignore file and added these lines:

/.local-chromium/
.local-chromium/
.local-chromium

initially I had added only the first line, since it did not work I did other tests but still it does not work.. the only other edit is that i've removed [Dd]ebug/, another lines that i've tried are

![Dd]ebug/*
[Dd]ebug/.local-chromium/

but does not work anyway

what am I doing wrong?

EDIT:

folder tree (.local-chromium is the only subfolder inside Debug):

|   |   
|   +---bin
|   |   \---Debug
|   |       |   files that i want to push,
|   |       |   just an exe and some dlls
|   |       \---.local-chromium
|   |           \---Win64-884014
|   |               \---chrome-win

EDIT: SOLVED. i dont know why but trying to commit the project from console instead of github desktop the role works fine.

  • Please list the contents of your git repository and the debug folder. What does “does not work” mean? Does git still show changes for .local-chromium? – x squared Aug 31 '21 at 22:02
  • @xsquared I am creating the repo, so there are no changes but I just see what is going to publish (I use github desktop). by "does not work" I mean that despite setting the rule (I think correctly), when I am about to publish I see that the .local-chromium folder is also loading. however I added the tree above – Marco Canazza Aug 31 '21 at 22:12
  • What does "when I am about to publish I see that the .local-chromium folder is also loading" mean? Was the content you are trying to ignore ever pushed to your repo? If it was, then it is tracked and tracked files are not affected by the ignore file. See here: https://stackoverflow.com/questions/1274057/how-can-i-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitign – TheIceBear Sep 01 '21 at 00:16
  • @TheIceBear sorry for my bad english, what i mean is that i'm doing the first commit, still no file is tracked, i do the first commit, i see that in it there is the folder i don't want and then i delete everything from github, delete the folder .git in the project and try again with another string, I did so for the numerous attempts but every time in the first commit that folder always appears, I can't get them to ignore it – Marco Canazza Sep 01 '21 at 09:29
  • get the subfolder's name and type it or if you have many subfolders create a folder and put all into that folder – Sarvesh Sep 01 '21 at 13:44
  • are you on windows? are you sure you don’t have create a .gitignore.txt by accident? – x squared Sep 02 '21 at 12:20

2 Answers2

0

if you want to ignore a file

just create a file called .gitignore

write /your file name(inside the .gitignore)

Sarvesh
  • 95
  • 1
  • 13
0

get the subfolder's name and type it or if you have many subfolders create a folder and put all into that folder

Sarvesh
  • 95
  • 1
  • 13