纯记录,没作分类git
git add [fileName] ——暂存某个文件
git add . ——暂存全部修改的文件
复制代码
git checkout [fileName] ——撤销某个文件
git checkout . ——撤销全部修改的文件
复制代码
git commit -m "你的提交备注"
缓存
git stash ——储藏
git stash pop/apply ——弹出储藏
git stash save 'message' ——储藏是加message
git stash drop stash@{$num} ——丢弃stash@{$num}存储,从列表中删除这个存储
git stash clear --删除全部缓存的stash
复制代码
git push [远程分支名]
复制代码
> git checkout [你要切换的分支名]
复制代码
注释:切换分支以前,必定要将修改的文件提交或者放进储藏区bash
git pull orgin [分支名]
git pull ——拉取当前分支的代码
复制代码
git merge [你要合并的分支名]
复制代码
git branch
复制代码
git branch -a
复制代码
git branch -m ordBranch newBranch
app
git branch -d/-D [你要删除的分支]
函数
git push origin --delete [你要删除掉的分支]
ui
等同于url
git push origin :[你要删除掉的分支]
spa
git push --set-upstream origin _branch
.net
git log
git log -5 查看五条记录
复制代码
git reflog
code
git reset [commitId] 回滚代码但修改的代码还在
git reset --hard [commitId] 回滚代码且修改的代码也没了
复制代码
git push orgin [当前分支]:devlop
git remote add origin 仓库地址
仓库地址:https://git.coding.net/xxxxxxxxxxxxx/my-project.git
git push -u orgin master
复制代码
git remote remove origin
git remote show origin 查看远程分支的信息
git remote prune origin --dry-run 查看可清理的远程分支
git remote prune origin 删除可清理的远程分支
复制代码
永久记录
git config --global credential.helper store
自定义记住时间 - 1小时
git config credential.helper ‘cache –timeout=3600’
git config --unset credential.helper
git remote set-url origin []
git clone -b <branch name> [remote repository address]
查看某某做者的提交
git log --author=某某
查看提交的文件
git log --stat
查看提交的文件修改
git log -p
按行查看提交记录
git log --pretty=oneline
显示新增、修改、删除的文件清单。
git log --name-status
找出添加或移除了某一个特定函数的引用的提交 好比 modal-wrapper
git log -Smodal-wrapper