ssh-key
ssh-keygen -t rsa -C "Z-Beatles@waynechu.cn"
cp ~/.ssh/id_rsa.pub ~/.ssh/Z-Beatles@waynechu.cn.pub
init repo
cd 'repo'
git init
git remote add origin git@github.com:Z-Beatles/reponame.git
git add .
git commit -m "reason"
git push origin master
clone repo
//Clone with SSH
git@github.com:Z-Beatles/MobileSafe.git
//Clone with HTTPS
https://github.com/Z-Beatles/MobileSafe.git
分支管理 branch
git branch
git branch 'newbranch'
git chechout 'branchname'
git checkout –b 'branchname'
git merge 'branchname'
git branch -d 'branchname'
git branc -D 'branchname'
查看文件 diff
//比较当前文件和暂存区文件差异
git diff <file>
git diff <id1><id1><id2>
git diff <branch1>..<branch2>
git diff
git diff
git diff
暂存管理 stash
git stash
git stash list
git stash apply
git stash drop
Git远程仓库管理
git remote -v
git remote show origin
git remote add origin git@github.com:Z-Beatles/reponame.git
git remote set-url origin git@github.com:Z-Beatles/reponame.git
git remote rm <repository>