pushing new changes to GitHub after deleting hidden .git directory

493 Views Asked by At

I've removed the hidden .git file from the project folder as I wanted to test pushing to a github directory from a new machine, can anyone list below the proper steps?

This is the message I got from the terminal:

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again

That is for reference only so please don't try to fix this error just focus on the main steps only with the assumption I went inside the project directory and removed the hidden .git file.

Possibly answer as follows:

  1. git pull
  2. git merge
  3. GIT PUSH so on...
1

There are 1 best solutions below

0
Amirsadjad On
  • Delete the new .git folder
  • clone the repo from git to your system
  • copy and paste the .git from newly downloaded repo to your existing project
  • Delete the downloaded repo