Giter Site home page Giter Site logo

learninggit's Introduction

Git is a distributed version control system.
Git is free software distributed under the GPL.
git command
    git add <file> # add a file to commit
    git commit -m <"note"> # commit all file to git as a version,-m add a note to this version
    git status # show the workspace status 
    git diff # compare the worspace between workspace of git.
    git log # view the log
    git log --pretty=oneline # show the log with a different view
    git reset  --hard HEAD^ # 回退至上个版本
    git reflog # 显示所有版本号
    git reset --hard <指定版本号> # 回退至指定版本
    git diff HEAD --<fileName> # 查看git中版本与工作区版本的不同
    git checkout -- <fileName> # 丢弃工作区的修改
    git reset HEAD <fileName> # 丢弃工作区的修改(已经add到暂缓区),再执行上句
    git rm <fileName> #将删除的文件提交到暂缓区
    ssh-keygen -t rsa -C "[email protected]" # 产生rsa密钥对(默认保存在user/.ssh目录下)
    git remote add origin [email protected]:<username>/<仓库名>.git # 关联github上的仓库
    git push -u origin master # 第一次推送至远程仓库
    git push origin master # 推送至远程仓库
    git clone [email protected]:<用户名>/<仓库名>.git # 从github上clone仓库到本地
    git checkout -b <分支名> # 创建一个分支并切换到这个分支
    git branch <分支名> # 创建一个分支
    git checkout <分支名> # 切换到指定分支
    git branch # 查看所有分支
    git branch # 查看所有分支 -d <分支名> 删除分支 
    git merge <分支名> 将分支合并到master上
    git log --graph --pretty=oneline --abbrev-commit  # 查看分支合并情况 --graph查看分支合并图

learninggit's People

Contributors

slivertwo 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.