Coder Social home page Coder Social logo

zmgit's Introduction

1. 本地操作

  1. 利用~\.bashrc修改git终端长命令,比如git-logll;
  2. git reset --hard commitid回退版本,git reflog查找所有版本历史;
  3. git checkout branchid是切换分支;
  4. 当有冲突时,先人工处理冲突,然后add,最后commit;
  5. 没有merge的分支,可以用git branch -D branchid删除;
  6. git restore --staged .可以将上次所有add的内容撤销,如果有.gitignore则只取消其不忽视的文件;

2. 远程操作

  1. git remote add remoteid remoteurl添加远程地址;
  2. git push remoteid branchid推送本地branchid至远程remoteid;
  3. git brach -vv查看分支更多信息
  4. git clone sshurl id.git克隆远程仓库到本地并以特有id为git库;
  5. git fetch抓取置零就是将仓库里的更新都抓取到本地,但不进行合并;
  6. git pull拉取指令就是将远端仓库的修改拉到本地并自动进行合并,相当于fetch+merge;
  7. 解决远程冲突就是先fetch+mergepull,修改完冲突后再push;

几条铁令

  1. 切换分支前先提交;
  2. 代码及时提交,提交就不会丢;
  3. 不要删除文件目录;

zmgit's People

Contributors

equatorer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.