github使用方法

    科技2025-05-30  7

    1.创建项目后,提交到master上

    1)git init

    2)  git add .

    3)  git commit -m "note"                     // note是提交说明

    4)  git remote add origin http.....git     // http.....git实现与仓库项目的关联

    5)  git push -u origin master

     

    2.提交到branch上

    1) git branch branch_name             // 创建分支branch_name

    2) git checkout branch_name         // 切换到分支

    3) git add .

    4) git commit -m "note"

    5) git push origin branch_name

     

    3.分支合并到主分支

    1) git checkout master         

    2) git merge dev

    3) git status

    4) git push origin master

    Note:利用github备份时,不要在远程仓库手动创建Readme.md文件,否则会造成远程仓库和本地仓库不一致,提交会出现问题。不要轻易pull远程仓库,本地仓库会被覆盖,无法找回。

    Processed: 0.011, SQL: 8