zoukankan      html  css  js  c++  java
  • 【git】.net core +git减少包体积

    我们一般上传到github上的项目 如果不了解gitignore 那一定是把项目编译转换的二进制代码全部上传上去了
    多则几十MB ,那么如何减少上传上去的体积?
    第一步:
    注册github -》然后点击” + “ 选择 "New repository"
    Owner :"仓库网路地址"
    Repository name :“仓库名称”

    Public:“公开-开源”
    Private:"私密-公司内部git管理使用"

    后面各个协议 比如MIT git 开源协议详细介绍 这里测试我就不勾选了
    完了之后 在你本地初始化仓库 (小技巧:windows 直接在 地址栏里面输入 cmd 就不用手写路径了)

    F:csrcsrzdddemo_1>git init      
    
    //这里先把忽略bin 文件 或是其它转义文件给去除掉
    F:csrcsrzdddemo_1>cd  .>.gitignore  //这里有个点注意看
    //打开gitignore   文件  然后把[VisualStudio.gitignore)](https://github.com/github/gitignore/blob/master/VisualStudio.gitignore) 把前辈写好的内容复制进去
    
    F:csrcsrzdddemo_1>git add --all    //把所有的文件缓存到本地仓库 并不推送
    
    //下一步
    F:csrcsrzdddemo_1>git remote add origin     https://csrzdd/demo       //关联你的远程仓库地址:会弹出一个 github登录密码和账号弹窗  没有安装GitHub Desktop 在cmd显示 请输入的邮箱 和密码 --密码是看不见的
    //第一种 如果输错了想删除密码重来  git config --system --unset credential.helper        (如果提示权限不够,那就右键以管理员的身份打开)
    //第二种 删除用户凭据也是可以的 在win10 的Cortana也就是sir 搜索 “凭据” 选择"windows凭据" 找到 “git:https://github.com” 删除再重新执行上面的步骤再次输入密码就可以了
    
    //下一步
    F:csrcsrzdddemo_1>git  commit -m "init core"   //更改说明 记得要写
     
    
    //注意:实际工作中一定是 自己创建一个分支,推送到自己创建的分支,然后主管来验收功能,最后审核通过合并,这里后续再细讲
    
    F:csrcsrzdddemo_1>git  push origin master //推送到远程仓库  
    //注意:如果你的项目上传上去 bin文件还在 请把本地track文件删除一下
    //出处: [Git 忽略提交 .gitignore](https://www.cnblogs.com/yxlblogs/p/5583483.html)
    git rm -r --cached .
    git add .
    git commit -m 'update .gitignore'
    //
    
    

    输入多了git命令 避免重复输入 你可以按键盘的 上 下 键选择
    如果看不太方便 按F7

  • 相关阅读:
    topcoder srm 445 div1
    topcoder srm 440 div1
    topcoder srm 435 div1
    topcoder srm 430 div1
    topcoder srm 400 div1
    topcoder srm 380 div1
    topcoder srm 370 div1
    topcoder srm 425 div1
    WKWebView强大的新特性
    Runtime那些事
  • 原文地址:https://www.cnblogs.com/cyCalf/p/10708515.html
Copyright © 2011-2022 走看看