1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GitHub Actions Self Hosted Runnerで.git/が存在しない場合の対処

Last updated at Posted at 2020-12-28

GitHub Actions Self Hosted Runnerで .git/ が存在せず git add が出来ない場合の対処をメモしておく.

結論

Gitのバージョンが2.18以上でないとDownloadになる.GitHub Actionsのログのメッセージに出力されていた.

To create a local Git repository instead, add Git 2.18 or higher to the PATH

対処

Ubuntu 18.04でapt経由でインストールすると古いGitになるので入れ替える.

参考: How To Install Git from Source on Ubuntu 20.04 [Quickstart] | DigitalOcean

現在のGitバージョンを確かめる.

$ git version
git version 2.17.1

以下のコマンドでgitを削除する.

$ sudo apt purge git

記事を執筆している時点での最新バージョンは 2.29.2 である.
ソースからGitをビルドする.

ソースコードの取得と解凍を行う.

$ cd /tmp
$ wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.2.tar.gz
$ tar xvf git-2.29.2.tar.gz
$ cd git-2.29.2/

ビルドに必要なパッケージ群を導入する.

$ sudo apt install libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc

ビルドを行いインストールをする.

$ ./configure
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

Gitが入れ替わったか確かめる.

$ exec bash
$ git version
git version 2.29.2

参考URL

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?