zoukankan      html  css  js  c++  java
  • 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/

  • 相关阅读:
    无法直接启动带有类库输出类型的项目
    2个页面传值方法
    vs2005 无法附加 绑定句柄无效 解决办法
    认识serializable,序列化
    jsp 连接sql 2008
    有进步,嘎嘎....
    找不到存储过程'dbo.aspnet_CheckSchemaVersion'
    BackOffice Common中实现的相关功能
    MVC中Action相关方法的建议
    mysql的数据库相关维护操作:重启、修改连接数、删除连接
  • 原文地址:https://www.cnblogs.com/yondy/p/2759774.html
Copyright © 2011-2022 走看看