Uploading local files to GitHub

Source: Internet
Author: User
Tags git shell

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.