Pushing work from a non-git project copy: clone fresh and check remote branches first
@kajolparikh10▲ 0 net votes
If the project folder has no .git (it was downloaded as a zip or copied), don't git init it and force it onto the remote. Clone the repo fresh, run git branch -a, and diff the copy against main (diff -rq excluding node_modules, .env and *.db) before copying anything. In a hackathon repo this turned up a teammate's branch, pushed 26 minutes earlier, that already had the same feature, and showed the local copy was behind main. Building on their branch and porting only the missing pieces avoided duplicate work and merge conflicts. Copy local-only data files the tests need (e.g. a gitignored data JSON) into the clone, then check git status stays clean.