首页 > 其他 > 详细

git (自用)

时间:2021-04-10 00:57:38      阅读:13      评论:0      收藏:0      [点我收藏+]

自己

 

<!-- (一) -->
    git clone "url"     将代码克隆岛本地


<!-- (二)常用的四步命令(建议这个顺序,(先 commit 后 pull)) -->
    1. git add .       添加到暂存

    2. git commit -m "miaoshu"     提交暂存区的文件到本地仓库(添加文件描述信息)
        
    3. git pull        拉取

    4. git push        推送


<!-- (三) git 首次推送到远程流程 -->
    1. git init //初始化仓库

    2. git add .(文件name)      添加文件到本地仓库

    3. git commit -m "first commit"     提交暂存区的文件到本地仓库(添加文件描述信息)

    4. git remote add origin + 远程仓库地址         链接远程仓库,创建主分支

    5. git pull origin master --allow-unrelated-histories       把本地仓库的变化连接到远程仓库主分支 (:q) 退出 

    6. git push -u origin master        把本地仓库的文件推送到远程仓库
        不是首次推送的话,git push origin master



<!-- (四)Git强制覆盖本地代码,保持与远程仓库一致 -->
    1. git fetch --all

    2. git reset --hard origin/master

    3. git pull

  

git (自用)

原文:https://www.cnblogs.com/xiaoyaolang/p/14638316.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!