Search code examples
visual-studiogithubgitignore

How to enable .gitignore file in private repository in GitHub with GUI


I can't uploud a project in private repository even I'have .gitignore file(where I made a mistake, because .gitignore doesn't work). Message is that I have more than a hundred files, and simply I can't uploud it in one piece, just one by one folder or file.

I have make a new private repository in GitHub, and at the start of making it's offering to make a gitignore file, so I done that step(I chose a Visual Studio gitignore file, and then I put all files I don't need, even a whole folders I don't need from my project I've made in VS). But problem is in uplouding folders after I make the repository. Every time I try to uploud it, I get a message that I have more than a hundred files. I've even opened a whole new private repository in case git alredy tracked the files in this one. And it seems nothing is working. I have reed all official documentacion about gitignore files in GitHub, I've seen a bunch of Youtube tutorials and tryed to make a gitignore file direct in VS but also doesn't work. Maybe it's seems funy to most of you and it is probably a banal mistake but I just can't figure this out. SENCE I'M A TOTAL BEGINNER please can anyone tell me where I make a mistake?

Here is a piece of my .gitignore file, most of it is official code, and it is very big.

  • *.tlh
  • *.tmp
  • *.tmp_proj
  • *.log
  • *.vspscc
  • *.vssscc
  • .builds
  • *.pidb
  • *.svclog
  • *.scc
  • App_Data/
  • Content/
  • fonts/
  • Scripts/
  • */favicon.ico
  • */packages.config

I just want my whole project uploud it in one piece without unnecessary files from VS.

  • List item

Solution

  • I will augment @Harmonica141 answers by suggesting you to use on line .gitignore file generator.
    After selecting desired IDE or programming language .gitignore file will be generated for you with all required regex and file exclusion.

    After downloading a file you need to add it to the repository by command line. Do as follows:

    cd into/the/repository/folder
    git add .gitignore

    git commit -m "Added .gitignore."
    git push origin