git-clone/init

three of the most popular
Git
Subversion
Mercurial
Two different caregories类别
  • the centralized model集中式模型
  • the distributed model分布式模型
命令
# 设置你的 Git 用户名
$ git config --global user.name "<Your-Full-Name>"

# 设置你的 Git 邮箱
$ git config --global user.email "<your-email-address>"

# 确保 Git 输出内容带有颜色标记
$ git config --global color.ui auto

#配置代码编辑器
$ git config --global core.editor <your-editor's-config-went-here>
# 对比显示原始状态

$ git config --global merge.conflictstyle diff3

$ git config --list
Git命令
Git init

Git init:create brand new repositoris from scratch on the computer

init:initialize
所需命令:

  • ls - 用来列出文件和目录
  • mkdir - 用来新建目录
  • cd - 用来更改目录
  • rm - 用来删除文件和目录

创建文件的方法:

mkdir udacity-git-course
cd ~/udacity-git-course
mkdir new-git-project

可以用以下命令直接代替

mkdir -p udacity-git-course/new-gitmproject && cd $_

运行git init可以创建隐藏 .git 目录。此 .git 目录是仓库的核心/存储中心

plumbing 底层
porcelain 上层

Git clone
Git clone:copy existing repos from somewhere else to your local computer

克隆仓库的命令是 git clone <url> 。 比如,要克隆 Git 的链接库 libgit2,可以用下面的命令:
$ git clone https://github.com/libgit2/libgit2
如果你想在克隆远程仓库的时候,自定义本地仓库的名字,你可以通过额外的参数指定新的目录名:
$ git clone https://github.com/libgit2/libgit2 mylibgit
这会执行与上一条命令相同的操作,但目标目录名变为了 mylibgit。
git clone --single-branch --branch <branchname> <remote-repo>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值