0

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!

The image for the commit box is shown below:enter image description here

3
  • 2
    If looks like you ran git init in your home directory... Commented Jan 27, 2021 at 11:16
  • 2
    Does this answer your question? How to undo git init on a home directory? Commented Jan 27, 2021 at 11:17
  • @jonrsharpe sorted thanks, I had to undo the git init then put some files on gitignore. Commented Jan 27, 2021 at 11:26

2 Answers 2

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

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

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.

6 Comments

I thought they had not pushed yet? These files look previously untracked?
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
Thanks, I've added something to the bottom to explain this :)
@TheOtterlord the files are not pushed yet, they are all in my local machine
@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.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.