git init
git config --global user.name 'yourName' git config --global user.email 'yourEmail'
git config --list git config user.name
git config --global push.default branchName git config --global push.default master
git add fileName
git commit -m 'comment'
git log git log --oneline git log dirName/fileName
git mv oldFileName newFileName
暫存區文件的修改git
git rm -f filename 文件強制刪除 git rm --cached filename保留本地文件
git revert HEAD 當前版本,從0開始計算 git revert HEAD~2 當前的第三次
git branch branchName
git checkout branchName
git merge branchName git merge branchName --no--ff
git branch -d branchName
git branch -d branchName git push --delete origin branchName
git diff git diff branchName1..branchName2
git branch -m oldBranchName newBrachName
git checkout -b branchName
git stash
git stash pop
<!--切換到須要提交的分支--> git remote add origin https://github.com/username/test.git
<!--推送提交的內容--> git push -u origin master
git branch -r
git checkout -b branchName origin/branchName
git remote remove origin //恢復使用 git remote add origin https://github.com/username/test.git //查看關聯狀況 git remote -v
git config --global alias.ci commit
位於~/.ssh中id_rsa和id_rsa.pubgithub
ssh-keygen -t rsa
將id_rsa.pub中內容複製到服務器/home/git.ssh/authorized中服務器
在項目目錄下新建.gitignoressh
而後中.gitignore中天劍須要忽略的文件日誌