The following are some series of errors I encountered with the git command line after not using xshell for a while and their solutions
Encountered this error:
fatal: Not a git repository (or any of the parent directories): .git
I consulted some blogs and information, the way to solve it:
git init
When I submitted files with git push, I encountered the following error
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
Solution:
git remote add origin 'http://git.....'
git push -u origin master
This error occurred:
Solution:
git pull --rebase origin master
Encountered error:
error: The following untracked working tree files would be overwritten by checkout
Solution:
git clean -d -fx
Encountered error:
** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'lvyp@NEU-20190128LYP.(none)')
Solution:
It means that you did not define the user name and mailbox when you created the local warehouse . At this time, follow the error prompt and use
git config --global user.name "follow"
git config --global user.email "[email protected]"
one more sentence
git config --local -l