Git Clone and Push ERROR: Repository not found

Krishna kushwaha
2 min readFeb 3, 2021

this fatal: not a git repository (or any of the parent directories): .git

  1. this error is coming only whenever you use different Github users.
  2. make sure you have login same Github user in terminal otherwise get error repository not found (or any parents directories access )
  3. reset all git terminal login using cmd
  4. echo -e “host=github.com\nprotocol=https\n” | git credential-osxkeychain erase
  5. git config — unset-all — global user.name
  6. git config — unset-all — global user.email

NOTE: not able to get username and password in Github terminal. you can use same command for this.

Bonus points —

for check user :

git config user.name
git config user.email

for change user :

git config --global user.name "Your User name"
git config --global user.email "Your Email"
  1. Create a new branch:
    git checkout -b feature_branch_name
  2. Edit, add and commit your files.
  3. Push your branch to the remote repository:
    git push -u origin feature_branch_name
  4. view current branch active
    git branch -a
  5. To rename a branch, run the command:
    git branch -m OLD-BRANCH-NAME NEW-BRANCH-NAME
  6. create new repository
echo "# abc" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/kushwaha03/abc.git
git push -u origin main

exiting repository

git remote add origin https://github.com/kushwaha03/abc.git
git branch -M main
git push -u origin main

Thanks

--

--

Krishna kushwaha
Krishna kushwaha

No responses yet