My .gitignore getting ignored when I try to perform git push

You can see my file structure of my React project and its .gitignore file in the attached pictures. I initiated an empty local repository, then I cloned an existing online repository into it. You can see I have my 'node_modules' listed inside of the .gitignore, which I believe is added by React automatically. I've just now replaced some larger image files with smaller ones and attempted to push that, but I'm running into issues. You can see, in the third attmt pic, when I go to push, it's picking out 2 files from my node_modules folder and giving me a warning on one and an error on the other, both related to their sizes. What is causing this? This is my first attempt at pushing to this repository, and all I've done so far is clone the repository that was online, using its GH address, into my local repository, that's all.
No description
No description
No description
8 Replies
Jochem
Jochem12mo ago
you really don't need to initialize an empty repo first, it's probably causing a bunch of issues just clone the remote repo, don't create an empty local one first
thethingisback
thethingisback12mo ago
I thought without a git init, it would't recognize any "git" command in that folder location, like the one needed to clone into the folder? like me typing "git clone [repo address]" would not be recognized by the terminal, since I hadn't initialized github first?
Jochem
Jochem12mo ago
it won't recognize most git commands, but init and clone will work anywhere
thethingisback
thethingisback12mo ago
oh okay trying that now That worked, it was the 'git init' that was causing problems. Cloning directly into. a blank folder allowed me to push without problems You wouldn't know off hand how to enable 'git' commands if a person is using Windows "powershell" instead of terminal would you?
Jochem
Jochem12mo ago
if git's in your path (as in, you can run it anywhere) it should Just Work™️ in powershell
Jochem
Jochem12mo ago
No description
Jochem
Jochem12mo ago
I don't remember doing anything in particular to get that to work
thethingisback
thethingisback12mo ago
okay, jsut checking, thank you for you help!
Want results from more Discord servers?
Add your server