git常用操作

来源:互联网 发布:时时彩搭建源码 编辑:程序博客网 时间:2024/06/11 10:01
git缩写配置:
在.gitconfig文件中添加:
[alias]
    br = branch
    co = checkout
    ci = commit
    st = status
    last = log -1 HEAD
git常用操作:
git clone 克隆一个分支
git br 查看分支,-a参数可列出所有分支
git co -b from_xxx 新建一个分支
git st 显示差异
git add xxx   添加文件
git diff 比较差异
git commit -a -m "xxx" 提交修改
git log 查看日志
git push origin from_xxx:from_xxx (git push) 推到远程仓库
git pull 拉取远程分支,并合并到本地
git fetch 拉取远程数据,不自动合并
git merge 合并分支
git blame -p filename 查看修改人
git tag 标签相关
git branch -d 删除分支
git remote -v 显示对应的地址
git rebase 变基合并

0 0
原创粉丝点击