:D 获取中...

1 Install

1.1 Create SSH key

ssh-keygen -t rsa -C "ywmu@live.com"

push Enter to generare id_rsa and id_rsa.pub in ~/.ssh/. To copy the content of id_rsa.pub to GitHub: Edit Profile->SSH and GPG keys->New SSH key.

1.2 Create repository

  • On GitHub: New repository->Enter the name (e.g., Scripts4VASP) and Create repository, swith to SSH for Quick Setup, and to excute on my computer:
mkdir -p /drives/e/Softs/DoNotSync/Git/MuScripts
cd /drives/e/Softs/DoNotSync/Git/MuScripts
echo " gg" >> README.md
git init
git config --global user.name "gitname"
git config --global user.email "mymail"
git add README.md
git commit -m "first commit"
git remote add MuScripts git@github.com:gitname/MuScripts.git
git push -u MuScripts master   for the first time

1.3 To use

  • modify README.md, to excute
git add README.md
git push [MuScripts master]
.......
git pull [MuScripts master]

to refresh.

1.4 add another computer

  • Create SSH key again.
  • on another computer:
mkdir -p /drives/e/Softs/DoNotSync/Git/MuScripts
cd /drives/e/Softs/DoNotSync/Git/MuScripts
git init
git config --global user.name "gitname"
git config --global user.email "mymail"
git remote add MuScripts git@github.com:gitname/MuScripts.git
git fetch --all
git reset --hard MuScripts/master
git pull -u MuScripts master  for the first time

1.5 Create another repository

mkdir /drives/e/Softs/DoNotSync/Git/MyAHK/
cd  /drives/e/Softs/DoNotSync/Git/MyAHK/
git init
echo " gg" >> README.md
git add README.md
git commit -m "first commit"
git remote add ahk git@github.com:gitname/MyAHK.git
git push -u ahk master

1.6 needed after every change

git add *
git commit -m 'revise 2'
git push