git常用指令

来源:互联网 发布:电信群发短信软件 编辑:程序博客网 时间:2024/06/18 07:42
本地仓库常用指令
git init :把目录变成仓库
git add xxx:把文件添加到仓库
git add --all :把目录下全部文件添加到仓库
git commit -m "tip":提交到仓库
git log :查看日记
git status :查看仓库状态
git reset --hard <commit_id> (HEAD^,HEAD~100):版本回退
git reflog:查看历史命令
git checkout --test.txt:用版本库里的版本替换工作区的版本
远程库指令
git remote add origin xxx.git:关联本地库
git push -u origin master:推送至远程库
git clone xxx.git:克隆远程库至本地
克隆之后:
git remote add pb http://git...xxx.git
原创粉丝点击