• git学习-来自慕课网


    git安装

    1. https://git-scm.com/downloads 下载地址
    2. 配置用户信息
       git config --global user.name "xxx"
       git config --global user.email "xxx@xxx.com"
    
    1. git config --list //查看参数配置信息

    SourceTree的安装

    git仓库

    • 初始化仓库

    git init

    • 添加文件到版本库

    git add

    git commit

    git commit -m "desc"

    • 查看仓库状态

    git status

    ls -a 可以查看隐藏的文件目录

    git 工作流

    从暂存区回退到工作区

    git reset HEAD xxx.txt

    git checkout -- xx.txt

    git log 找到提交版本号

    git reset --hard 版本号 回退

    远程仓库

    1. 创建SSH key

      ssh-keygen -t rsa -C "youremail@example.com"

    2. 个人用户目录下 .ssh目录下 id_rsa.pub内容复制到github 的key中

    3. 添加远程仓库

      git remote add origin git@github.com:xxx/xxx/git

      git push origin master

      git push -u origin master

      git push origin master

    标签管理

    git tag 查看所有标签

    git tag tagname 创建标签

    git tag -a tagname -m "common" 指定提交信息

    git tag -d tagname 删除标签

    git push origin tagname 推送标签/标签发布

    git分支管理

    git branch查看分支

    git branch branch_name 创建分支

    git checkout branch_name切换分支

    合并分支

    1. 切换到master分支 git checkout master
    2. 合并 git merge branch_name
  • 相关阅读:
    POJ-2378 Tree Cutting
    ZOJ-3870 Team Formation
    POJ-1741 Tree (树上点分治)
    POJ-3107 Godfather
    HDU-3586 Information Disturbing(树形DP+删边)
    POJ 2796 (单调栈 + 前缀和)
    POJ 3250(单调栈)
    ATCoder 116 D (思维+贪心+栈)
    POJ2528 (离散化+线段树)
    HDU 2795(思维+线段树)
  • 原文地址:https://www.cnblogs.com/bigorang/p/9734605.html
Copyright © 2020-2023  润新知