Git Clone and Push ERROR: Repository not found
2 min readFeb 3, 2021
this fatal: not a git repository (or any of the parent directories): .git
- this error is coming only whenever you use different Github users.
- make sure you have login same Github user in terminal otherwise get error repository not found (or any parents directories access )
- reset all git terminal login using cmd
- echo -e “host=github.com\nprotocol=https\n” | git credential-osxkeychain erase
- git config — unset-all — global user.name
- 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"
- Create a new branch:
git checkout -b feature_branch_name
- Edit, add and commit your files.
- Push your branch to the remote repository:
git push -u origin feature_branch_name
- view current branch active
git branch -a
- To rename a branch, run the command:
git branch -m OLD-BRANCH-NAME NEW-BRANCH-NAME
- 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