zoukankan      html  css  js  c++  java
  • Git

    Git 初始化

    查看版本

    $git --version

    设置git当前用户姓名和邮件地址

    $git config --global user.name "Danz"

    $git config --global user.email danzhangnb@gmail.com

    查询

    $git config user.name

    删除

    $git config --unset --global user.name

    设置别名

    $sudo git config --system alias.st status(未成功)

    另:只在本用户的全局配置中添加别名

    $git config --global alias.st status

    开启颜色显示

    $git config --global color.ui true

    创建版本库

    $mkdir demo

    $cd demo

    $git init

    创建一个文件welcome.txt内容为Hello.

    $echo "Hello." > welcome.txt

    显示版本库.git目录所在位置

    $git rev-parse --git-dir

    显示工作区根目录

    $git rev-parse --show-toplevel

    相对于工作区根目录的相对目录

    $git rev-parse --show-prefix

    显示从当前目录(cd)后退(up)到工作区的根的深度

    $git rev-parse --show-cdup

    帮助

    $git --help

    usage: git [--version] [--help] [-C <path>] [-c name=value]
    [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
    [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
    [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
    <command> [<args>]

    add Add file contents to the index
    bisect Find by binary search the change that introduced a bug
    branch List, create, or delete branches
    checkout Checkout a branch or paths to the working tree
    clone Clone a repository into a new directory
    commit Record changes to the repository
    diff Show changes between commits, commit and working tree, etc
    fetch Download objects and refs from another repository
    grep Print lines matching a pattern
    init Create an empty Git repository or reinitialize an existing one
    log Show commit logs
    merge Join two or more development histories together
    mv Move or rename a file, a directory, or a symlink
    pull Fetch from and integrate with another repository or a local branch

    push Update remote refs along with associated objects
    rebase Forward-port local commits to the updated upstream head
    reset Reset current HEAD to the specified state
    rm Remove files from the working tree and from the index
    show Show various types of objects
    status Show the working tree status
    tag Create, list, delete or verify a tag object signed with GPG

    产生40位ID

    $git log --pretty=fuller

    修改welcome.txt

    $echo "Nice to meet you." >>welcome.txt

    添加到递交任务

    $git add welcome.txt

    $git status

    (精简)$git status -s

  • 相关阅读:
    iis7无法写入配置文件
    重写基类方法与隐藏基类方法的区别
    观察者模式上班玩游戏,老总是怎么知道的?
    Session过期和清除缓存 .
    C#基础概念
    php反序列化漏洞绕过魔术方法 __wakeup
    Shadow broker=>fuzzbunch+metasploit 攻击外网测试以及metasploit大批量扫描目标IP
    Python “ValueError: incomplete format” upon print(“stuff %” % “thingy”) 解决方法
    CSTC2017Webwriteup
    php 弱类型总结
  • 原文地址:https://www.cnblogs.com/danznb/p/3570369.html
Copyright © 2011-2022 走看看