I am new to git functions and I wrote a set of code, I intend to push it to Github but my commit report is showing over 5000 files, I do not know where such heavy set of commits emanated from. Please help!
Asked
Active
Viewed 51 times
0
-
2If looks like you ran `git init` in your home directory... – jonrsharpe Jan 27 '21 at 11:16
-
2Does this answer your question? [How to undo git init on a home directory?](https://stackoverflow.com/questions/15193565/how-to-undo-git-init-on-a-home-directory) – evolutionxbox Jan 27 '21 at 11:17
-
@jonrsharpe sorted thanks, I had to undo the git init then put some files on gitignore. – Sam Bayo Jan 27 '21 at 11:26
2 Answers
1
Had the exact same problem.
In Vscode open the drop down "SOURCE CONTROL REPOSITORIES" at the top of the source control panel.
Then right click on the repo which is incorrectly set and select Close Repository.
Here is a visual of the answer

Pratik Fagadiya
- 1,195
- 7
- 21

Vegozzy
- 91
- 1
- 3
0
You have a lot of files in folders you do not want to be pushing. The .cache folder for example. You can fix this by creating a .gitignore file containing the paths that you don't want to push.
For example, to add the .cache folder to .gitignore, you can use.
.cache
Figure out which files you want to push to github, and which you should not be pushing. Also, if you have already pushed any files to the repo that are included in the .gitignore, you will need to remove them.

The Otterlord
- 1,680
- 10
- 20
-
I thought they had not pushed yet? These files look previously untracked? – The Otterlord Jan 27 '21 at 11:12
-
I have a .gitignore file already, how do I put those files there? Because I have done a system search, I cannot even find the location of those unwanted files on my machine – Sam Bayo Jan 27 '21 at 11:14
-
-
@TheOtterlord the files are not pushed yet, they are all in my local machine – Sam Bayo Jan 27 '21 at 11:14
-
@SamBayo The gitignore just defined the paths of the files. Open the gitignore and add the path of the directories you don't want to include. – The Otterlord Jan 27 '21 at 11:15
-