質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

BitBucket

BitBucketは無料のリポジトリ管理ホスティングサービスです。 MercurialとGitのVCSに対応しています。プライベートリポジトリを、制限なく作成することが可能です。

Q&A

解決済

1回答

1617閲覧

bitbucketにpush出来ない

mika_yamano

総合スコア3

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

BitBucket

BitBucketは無料のリポジトリ管理ホスティングサービスです。 MercurialとGitのVCSに対応しています。プライベートリポジトリを、制限なく作成することが可能です。

0グッド

0クリップ

投稿2020/11/02 16:33

開発環境ubunt18.04
ターミナルで
git init
git add -A
git remote add origin git@bitbucket.org:yamano1122/piano.git
git push -u origin --all
としたところ下のエラーが出ました。

To bitbucket.org:yamano1122/piano.git
! [rejected] master -> master (fetch first)
error: could not lock config file .git/config: 許可がありません
error: Unable to write upstream branch configuration
ヒント:
ヒント: After fixing the error cause you may try to fix up
ヒント: the remote tracking information by invoking
ヒント: "git branch --set-upstream-to=origin/modify-README".
error: update_ref failed for ref 'refs/remotes/origin/modify-README': cannot lock ref 'refs/remotes/origin/modify-README': unable to create directory for .git/refs/remotes/origin/modify-README
error: failed to push some refs to 'git@bitbucket.org:yamano1122/piano.git'
ヒント: Updates were rejected because the remote contains work that you do
ヒント: not have locally. This is usually caused by another repository pushing
ヒント: to the same ref. You may want to first integrate the remote changes
ヒント: (e.g., 'git pull ...') before pushing again.
ヒント: See the 'Note about fast-forwards' in 'git push --help' for details.

管理者でやればいいのでは思い実行すると
sudo git push -u origin --all

git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
となってしまいました…どこをどうしたらいいのでしょうか?

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

リモートにあなたが行った作業が含まれているため、更新は拒否されました

と言ってるので、
そのリポジトリを別のフォルダにCloneして、それに追加するなり修正するなりして、add、commit、pushしましょう

投稿2020/11/02 21:37

編集2020/11/02 21:39
y_waiwai

総合スコア87774

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

mika_yamano

2020/11/04 09:48

無事出来ました、ありがとうございます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問