您的位置:首页 > 其它

Git的一些长用命令

2015-04-10 14:32 141 查看
git clone 路径

git clone -b develop 路径 克隆develop分支

使用git status命令查看我们做过哪些修改,建议在提交前都调用一下这个命令,看看我们做过什么改动

git checkout -b develop 切换到develop分支 如果没有develop就创建一个新的

git branch-------------------查看当前属于哪个分支

删除本地缓存的targt/ 下的文件

git rm -r --cache target/

#添加并提交文件或文件夹

git add . | file 添加文件下所有 git add 文件加/.

git commit -m "description"

#指定了git项目后此句可不写,只有第一次往远程添加提交时写

git remote add origin url路径

git push -u origin develop 提交到develop分支上

git push -u origin master

#删除已提交的文件或文件夹

git rm -rf file | "folder"

git commit -m 'descriptiom'

git push -u origin master

从远程git服务器上更新资源:

git pull

#检查已有的配置信息

git config --list

#设置提交者名字

git config --global user.name "userName"

#设置提交者邮箱

git config --global user.email "userEmailAdress"

使用git提交比较大的文件的时候可能会出现这个错误

error: RPC failed; result=22, HTTP code = 411

fatal: The remote end hung up unexpectedly

fatal: The remote end hung up unexpectedly

Everything up-to-date

这样的话首先改一下git的传输字节限制

git config http.postBuffer 524288000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: