• git 常用命令


    git 文件名乱码 http://zengrong.net/post/1249.htm

    git config –global core.quotepath false  

    当前分支打包 http://web.mit.edu/~thefred/MacData/afs/sipb/project/git/git-doc/git-archive.html

    git archive --format=tar -o latest.tar.gz HEAD  

    克隆 master

    git clone <git_url>  

    克隆远程分支

    git clone --branch <remote_branch_name> <git_url>  
    git clone <git_url> -b <remote_branch_name>   

    查看所有分支

    git branch -a  

    更新 remote 索引

    git fetch   

    显示对应的克隆地址

    git remote -v  

    查看远程仓库信息

    git remote show origin  

    查看所有分支

    git branch -r  

    列出仓库中所有的头

    git show-ref  

    打补丁

    git apply ***.diff  

    提交分支数据到远程服务器

    git push origin <local_branch_name>:<remote_branch_name>  

    分支再建分支

    git branch new-branch-name origin/old-branch-name  

    提交master分支数据到远程服务器

    git push origin HEAD:master  

    添加一个新分支

    git branch <branch_name>  
    git checkout <branch_name>  
    git push origin <remote_branch_name>  
    

    添加一个已存在远程分支的分支

    git clone ***  
    git fetch origin  
    git branch dev refs/remotes/origin/dev 或 git branch dev -b  
    

    删除本地分支

    git branch -d <local_branch_name>  

    删除远程分支

    git push origin :<remote_branch_name>  

    cat .git/config

    [core]  
        repositoryformatversion = 0  
        filemode = true  
        bare = false  
        logallrefupdates = true  
    [remote "origin"]  
        fetch = +refs/heads/*:refs/remotes/origin/*  
        url = git+ssh://git@git.***.com/***  
    [branch "master"]  
        remote = origin  
        merge = refs/heads/master  
    [branch "develop"]  
        remote = origin  
        merge = refs/heads/develop  
    

    管理配置

     
    [group dev-team]  
    writable = projects  
    members = uesrs  
      
    [group readonly]  
    writable = projects  
    members = users  
      
    [group project_readonly]  
    readonly = project  
    members = user  
    

    引用 http://progit.org/book/zh/

  • 相关阅读:
    Python-炫酷二维码
    Dictionary 序列化与反序列化
    获取数据库所有表名与字段名
    LinQ To Object 基本用法
    使用jq操作脚本生成元素的事件
    表单验证如何让select设置为必选
    js实现复制功能兼容ios
    微信小程序使用函数防抖解决重复点击消耗性能问题
    electronr进行签名与公证
    使用electron在mac升级签名后进行升级出现“QRLUpdaterErrorDomain”的错误
  • 原文地址:https://www.cnblogs.com/yondy/p/2759774.html
Copyright © 2020-2023  润新知