美文网首页
git的常规操作

git的常规操作

作者: sws1314 | 来源:发表于2021-03-29 11:00 被阅读0次

    git的常规操作

    .gitignore不起作用
    git rm -r --cached .
    git add .
    git commit -m "update .gitignore file"
    git push
    
    添加远端
    git remote add origin   远端地址
    
    git push -u origin master
    或者
    git push origin master
    
    撤销commit
    git reset --soft HEAD~1
    
    命令行解释

    如果进行两次的commit,想要都撤回,可以使用HEAD~2

    上传的文件超过100M
    # 从缓存中删除(在git的顶级目录执行以下代码)
    git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch 要删除的文件路径' --tag-name-filter cat -- --all
    # 再次进行push操作
    git push origin master
    

    相关文章

      网友评论

          本文标题:git的常规操作

          本文链接:https://www.haomeiwen.com/subject/azavhltx.html