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中天剑须要忽略的文件日志