Due
git github cartridge to the centos
First of all
- Download git
yum install git -y
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 informationCreate a local repository:
mkdir gitspace
cd gitspace
git init
# git repository becomes the current directoryAdd
Touch README.md
git add README.md
git commit -m"first upload"
git status
# View statePrivate 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