20
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

githubからアクセストークンでcloneする

概要

dockerなどを使っている場合に、ID/PASSや秘密鍵・公開鍵を使わずに、簡易にcloneできないか調べた内容をメモしておく。

サンプルコマンド

# Config
$ export GIT_EMAIL=hoge@example.com
$ export GIT_USER=hoge
$ export GIT_TOKEN=************************
$ export GIT_REPOSITORY=Example-Inc/example.com.git

# Git
$ git clone https://${GIT_USER}:${GIT_TOKEN}@github.com/${GIT_REPOSITORY} .
$ git config --local user.name ${GIT_USER}
$ git config --local user.email ${GIT_EMAIL}

参考サイト

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
20
Help us understand the problem. What are the problem?