First step: Create a new warehouse
Tick initialize this repository with a readme option to automatically create reamde.md files.
Step Two:
$ git config --global user.name "hanyuntao"
$ git config --global user.email "[email protected]"
Step three: Generate SSH key
First check whether the key has been generated cd ~/.ssh
, and if ls
there are 3 files returned, the key has already been generated.
If there is no key, pass the
$ ssh-keygen -t rsa -C "[email protected]"
Generated, the process of generating a 3-time enter the return.
After the build succeeds, go to the corresponding directory to find id_rsa.pub with Notepad open, get SSH key public key.
Fourth step: Configure SSH key for GitHub account
Fifth step: Enter the command under GIT shell to test if the public key is properly authenticated.
ssh-t [email protected]
The correct results are displayed:
warning:permanently added ' github.com,207.97.227.239 ' (RSA) to the list of known hosts.
Hi flowerowl! You've successfully authenticated, but GitHub does not provide shell access.
Warning don't bother.
Sixth step: Switch to the git shell command line and enter the command:
git init git commit-m ' stumansys ' git remote add origin https://github.com/Flowerowl/stumansys.git git push Origin mas ter
If you execute git remote add origin
Https://github.com/Flowerowl/stumansys.git
, an error occurred:
Fatal:remote origin already exists
The following statement is executed:
Git remote RM origin
Then execute git remote add Origin https://github.com/Flowerowl/stumansys.git .
When executing GIT push Origin master, an error occurred:
error:failed to-push som refs to ....
The following statement is executed:
Git pull Origin Master
If it still does not succeed
git remote set-url origin [email protected]:username/repository
These problems are probably encountered during the upload process.
Uploading local files to GitHub