1

I have a cloned repo in my linux machine.I am trying to push that cloned repo from my linux machine to a git hub account. I have created the github account and I am followed the commands in the github page to push.

#push an existing repository from the command line
git remote add origin https://github.com/xxx/yyy.git
git push -u origin master 

The above command was given in the github page to push the existing repo. I ran the below commands in my linux machine

git config --global user.name "xxx"
git config --global user.email "xxx@gmail.com"
git remote add origin https://github.com/xxx/yyy.git

Am getting the below error:

Not a git repository (or any parent up to mount point /home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

James Z
  • 12,209
  • 10
  • 24
  • 44
clarie
  • 15
  • 3
  • Does this answer your question? [Git push existing repo to a new and different remote repo server?](https://stackoverflow.com/questions/5181845/git-push-existing-repo-to-a-new-and-different-remote-repo-server) – Shawn Mar 24 '20 at 09:23
  • Though that error kind of sounds like you're not in the directory tree of your local repo when you you try to work on it. – Shawn Mar 24 '20 at 09:27
  • 1
    You are not inside a repo when running you git commands. That is what the error is telling you. Either clone the repo, or create one first with git init and then add the origin to it. – The Fool Mar 24 '20 at 09:30

1 Answers1

0

someone probably delete .git folder.

  • leave the current folder
  • rename the current folder of your project to anything (qwertyfor example)
  • clone repository again
  • open the cloned repository folder
  • deleta all content but .git folder
  • copy and paste the content of qwerty inside the cloned repository folder
  • git add .
  • git commit -m 'update'
  • git push
Henryk Budzinski
  • 1,161
  • 8
  • 20