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 5 years have passed since last update.

gitでpushやpullができなくなったときに対処した方法

Last updated at Posted at 2019-09-02

先日、急にリモートリポジトリへのpushpullができなくなってしまいました。
原因は特定できなかったものの、なんとか対処することができたので、その方法を書いていきます。

権限を外されたのではないか

リモートリポジトリを管理している人が私ではなかったので、リモートリポジトリを管理している人に直接聞いてみました。
しかし、権限を外したような設定はしていないとのことで、これが原因ではなさそうです。

色々調べる

まず、git remote -vで remote のリポジトリのアドレスを調べてみます。

$ git remote -v
origin [URL] (fetch)
origin [URL] (push)

次に、git config --listで調べます。

$ git config --list
credential.helper=osxkeychain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
user.name=KenAra
user.email=xxxxx@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.url=git@github.com:xxxxx/xxxxx.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

最終的な解決方法

色々試しましたが結局のところ、もう一度git remote addを行うことで復活させることができました!

$ git remote add origin https://[username]:[password]@/github.com:xxxxx/xxxxx.git

原因は特定できませんでしたが、なんとかpushpullをできるようになったのでよかったです。

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?