美文网首页
git 学习

git 学习

作者: 残风疏影 | 来源:发表于2017-07-05 17:37 被阅读0次

    apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev

    apt-get install git-core

    git --version

    Git 配置
    Git 提供了一个叫做 git config 的工具,专门用来配置或读取相应的工作环境变量。
    这些环境变量,决定了 Git 在各个环节的具体工作方式和行为。这些变量可以存放在以下三个不同的地方:
    /etc/gitconfig 文件:系统中对所有用户都普遍适用的配置。若使用 git config 时用 --system 选项,读写的就是这个文件。
    ~/.gitconfig 文件:用户目录下的配置文件只适用于该用户。若使用 git config 时用 --global 选项,读写的就是这个文件。
    当前项目的 Git 目录中的配置文件(也就是工作目录中的 .git/config 文件):这里的配置仅仅针对当前项目有效。每一个级别的配置都会覆盖上层的相同配置,所以 .git/config 里的配置会覆盖 /etc/gitconfig 中的同名变量。

    git config --global user.name "hl"

    git config --global core.editor vim

    git config --global merge.tool vimdiff

    git config --list

    git init

    git init newrepo

    git add test

    git status -s

    git commit -m 'add test'

    git push -u origin master

    git config --global user.name "He Lei"
    git config --global user.email "helei@handge.cn"

    git clone http://172.18.20.250/hl/hl.git
    cd hl
    touch README.md
    git add README.md
    git commit -m "add README"
    git push -u origin master

    cd existing_folder
    git init
    git remote add origin http://172.18.20.250/hl/hl.git
    git add .
    git commit -am 'add'
    git push -u origin master

    git pull

    相关文章

      网友评论

          本文标题:git 学习

          本文链接:https://www.haomeiwen.com/subject/juiqhxtx.html