zoukankan      html  css  js  c++  java
  • Git使用

    安装 :  # yum  install git

    使用 Git 来获取 Git 的升级:# git clone git://git.kernel.org/pub/scm/git/git.git

    初次运行 Git 前的配置

    用户信息设置

    [root@localhost ~]# git config --global user.name "dxtrp"   # 设置用户名
    [root@localhost ~]# git config --global user.email "ttrrpp@gmail.com"   #  设置电子邮件
    [root@localhost ~]# git config --global user.email   # 确认在 Git 中正确设置了电子邮件地址
    ttrrpp@gmail.com

    [root@localhost ~]# git config --global core.editor vim  # 设置编辑器
    [root@localhost ~]# git config --global core.editor  # 检查设置的编辑器
    vim

    检查配置信息

    [root@localhost ~]# git config --list
    user.name=dxtrp
    user.email=ttrrpp@gmail.com
    core.editor=vim

    获取帮助

    $ git help <verb>
    $ git <verb> --help
    $ man git-<verb>

    Git 基础

    能够配置并初始化一个仓库(repository)、开始或停止跟踪(track)文件、暂存(stage)或提交(commit)更改。

    如何配置 Git 来忽略指定的文件和文件模式、如何迅速而简单地撤销错误操作、如何浏览项目的历史版本以及不同提交(commits)间的差异、如何向远程仓库推送(push)以及如何从远程仓库拉取(pull)文件。

    - 获取 Git 仓库

    有两种取得 Git 项目仓库的方法。 第一种是在现有项目或目录下导入所有文件到 Git 中; 第二种是从一个服务器克隆一个现有的 Git 仓库。

    在现有目录中初始化仓库

    [root@localhost ~]# git init
    已初始化空的 Git 仓库于 /root/.git/

    克隆仓库的命令格式是 git clone [url] 。 比如,要克隆 Git 的可链接库 libgit2,可以用下面的命令:

    $ git clone https://github.com/libgit2/libgit2

  • 相关阅读:
    C#中get和set的写法
    FineUI中Newtonsoft.Json版本报错解决办法
    ExtAspNet和FineUI未将对象引用设置到对象的实例
    【转载】写runat="server"有什么用
    (object sender,EventArgs e)是什么?
    【转载】onclick与onCommand的区别
    简单总结------redis
    将list等分成n份
    将List 分成n个长度由调用者指定的子List
    CountDownLatch 我的应用场景
  • 原文地址:https://www.cnblogs.com/ttrrpp/p/12173404.html
Copyright © 2011-2022 走看看