git github repository

Due

git github cartridge to the centos

First of all

  1. Download git
    yum install git -y
  2. Configure git
    git config --global user.name "Your Name"#new name
    git config --global user.email "[email protected]"#new Email
    git config --list# View configuration information

  3. Create a local repository:
    mkdir gitspace
    cd gitspace
    git init# git repository becomes the current directory

  4. Add
    Touch README.md
    git add README.md
    git commit -m"first upload"
    git status# View state

  5. Private configuration
    locally generated private key
    ssh-keygen -t rsa -C "[email protected]"# even three press I Enter

cat /root/.ssh/id_rsa.pub # view and copy the private keys

The locally generated private key provided to github
disposed in ssh key settings
remember following tick ✔ read permission allowing

  • Github execute commands
    git remote add origin xxx# to add a remote repository local repository
    git push -u origin master# the local repository pushed to far above the remote repository master branch

Reference:
https://www.cnblogs.com/daniaofighter/p/9452661.html
https://www.jianshu.com/p/4f3bbc566e76
https://www.jianshu.com/p/2779b5d6a59a

Guess you like

Origin www.cnblogs.com/unixcs/p/12306013.html