【代码总结】关于Git命令行的使用

    技术2022-07-10  135

    对于新项目需要

    git init

    将本地项目中所有文件添加至.git中

    git add .

    提交并添加备注

    git commit -m "xxx"

    远程连接仓库

    git remote add origin https://github.com/Elivyxy/xxx.git

    全部上传至远程仓库

    git push -u origin master

    可能远程仓库中已有文件而本地不存在,需要进行合并

    git pull --rebase origin master

    遇到 ! [rejected]        master -> master (non-fast-forward)这种问题时

    git pull origin master --allow-unrelated-histories

     

    Processed: 0.013, SQL: 9