zoukankan      html  css  js  c++  java
  • Git 版本管理 add rm commit push pull

    $ git config --global user.name "Your Name"
    $ git config --global user.email "email@example.com"

    $ git remote add origin https://XXXX

    $ git init

    git add filename

    git commit -m "comment message"

    添加新内容

    git add

    git status

    git commit -m‘add something’ (add something为备注)

    git push

    删除文件(文件夹)

    git rm Date -r -f

    git commit -m'delete something'(delete somgthing 备注)

    git push

    branch

    git branch

    git branch new

    git push origin new

    git checkout new

    git branch -d new

    git branch -r -d origin/new

    git push origin :new

    clone 分支

    git clone -b develop https://git.XXX.git

    git add -A = git add . + git add -u

    • git add -A   stages All
    • git add .   stages new and modified, without deleted
    • git add -u     stages modified and deleted, without new

    git reset --hard FETCH_HEAD

    git pull

    Error:

    You are not currently on a branch.

    git checkout -b temp

    git checkout master

    git pull

  • 相关阅读:
    内部类的作用
    zookeeper(1)-概述
    @RequestBody、@ResponseBody注解是如何将输入输出转换成json的
    HashMap之红黑树
    HashMap深入理解
    SpringBoot的四种定时任务
    Redis基础
    Redis内存回收机制
    高频面试题
    36. Valid Sudoku
  • 原文地址:https://www.cnblogs.com/fangchun/p/4639907.html
Copyright © 2011-2022 走看看