linux 下向github上传代码

上传代码:

cd TPS/devices/M8

git init                      #//初始化 

git add .                    #如果是.表示上传全部目录下的文件,可以是某个文件

git commit -m 'version 1.0'

git remote add origin https://github.com/jiugui1/TOS.git

git push origin master -f

#ghoul@m:~/tos/TPS/devices/M8$ git push origin master -f

Username for 'https://github.com': bsh1990cao@gmail.com    //输入github账号

Password for 'https://bsh1990cao@gmail.com@github.com': //输入github登陆密码

如果输入$ git remote add origin git@github.com:djqiang(github帐号名)/gitdemo(项目名).git

  提示出错信息:fatal: remote origin already exists.

    解决办法如下:

    1、先输入$ git remote rm origin

    2、再输入$ git remote add origin git@github.com:jiugui1/TOS.git

  

 就不会报错了!

git filter-branch --tree-filter 'rm -f WebRoot/WEB-INF/lib/*.jar' --tag-name-filter cat -- --all

git push origin --tags --force

git push origin --all --force


大文件害死人!!!不能上传大于100M的文件!!!


git rm --cached backup/20151119143722/package/M8.zip


原文地址:https://www.cnblogs.com/Yemilice/p/6217243.html