Home > database >  Why is git pushing unnecessary folders to my repo?
Why is git pushing unnecessary folders to my repo?

Time:05-18

When I do a git push for one folder in my documents, somehow, all of my folders/files in my Projects folder are pushed. I'm making sure that when I run the 'git push' command, my path is in the folder that I want. For instance:

PS C:\Users\19802\Documents\Projects\digital_rolodex>

I'm moved the files out of the documents so that they're not pushed and they still keep getting pushed. Every time I set up a new repo, the folders are still pushed, even though the repo was deleted and the folders were removed. I've deleted the repo and started over twice nice and it keeps doing the same thing, saying they were pushed days ago. I've made sure to change branches, tried that, this didn't help. I've removed them from my commits and source control, these files keep getting pushed to every new repo I create.

I can't find any documents on the internet about this, so any help would be greatly appreciated.

CodePudding user response:

git push doesn't push folders; it pushes commits.

Your branch apparently contains commits with changes to the files in question, and they are therefore pushed.

If you want to push just changes to one folder, you would have needed to create a branch that contains commits that only modify files in that folder.

CodePudding user response:

Unfortunately, that isn't working. However, @torek, with your explanation, I was able to identify and fix the problem.

  • Related