• 学习git


    git一直没掌握熟练,写记录一下常用的操作及遇到的问题

    远程克隆库: git clone ssh://git@xxx or git clone http://git@xxx
    库初始化: git init

    查看当前分支 : git branch

    查看远程分支: git branch -r

    提交文件到远程仓库的流程:
    
    1. git add 文件名
    
    2. git commit -m "提交的描述信息"
    
    3. git push origin master (把本地内容推送到主分支)
    
       git push origin master_name:branch_name(将本地内容推送到主分支下的分支)
    
    
    创建一个分支用于个人修改:
    • 创建分支

    git checkout -b name (创建分支等同于:git branch name + git checkout branch_name)

    • 查看当前分支

    git branch

    • 在分支上修改内容再提交

    git add xxx

    git commit -m "提交描述信息"

    • 分支工作完成后切换到主分支

    git checkout master

    • 把分支上的工作合并到主分支

    git merge branch_name

    • 删除分支

    git branch -d branch_name

    遇到问题

    在git push过程中出现hint:updates were rejected...的解决方法:

    • git stash

    • git pull origin branch_name -v

    • git stash pop

    • git push origin branch_name -v

  • 相关阅读:
    201703-1 分蛋糕
    201812-2 小明放学
    201812-1 小明上学
    逆向_Easy_vb
    逆向_入门逆向
    代码审计_弱类型整数大小比较绕过
    代码审计_数组返回NULL绕过
    代码审计_md5()函数
    代码审计_urldecode二次编码绕过
    代码审计_extract变量覆盖
  • 原文地址:https://www.cnblogs.com/joy-li/p/6925172.html
Copyright © 2020-2023  润新知