件名のままなのですが、sourcetreeに甘えていて、いざターミナル内からのCUI操作で件名のことをしようとしてもできません、、、
sourcetreeでは毎回パスワード入力が面倒なので公開鍵のssh接続でpushとかしています。
ペアキーは~/.sshにあります。
で、今回つまづいているのがXSERVER内での出来事。
[mg1986jp@sv5015 scripts]$ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Warning: Permanently added the RSA host key for IP address '104.192.143.1' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. [mg1986jp@sv5015 scripts]$
解決法として、XSERVER内のプロジェクトをPC(mac)側に持ってきて、sourcetreeでbitbucketに非公開リポジトリを作って既存プロジェクトをその非公開リポジトリにpushすれば、あとはgitが使えるどっかのサーバーでcloneすれば解決はしますが、目的はGUIがなくてもできるようになること、、、コマンドでやりたいんですなぁ、、、GUIがない現場だと困りますからなぁ、、、
本題ですが、時系列で書いていきますね。
bitbucketのペアキーをとりあえず、XSERVER内の~/.sshにも設置。
MG-MacBook-Pro:~ MacPRO-N-GOTO$ scp -i ~/.ssh/xserver_mg1986jp -P 10022 ~/.ssh/mg1986jp-Bitbucket.pub mg1986jp@mg1986jp.xsrv.jp:.ssh/ Enter passphrase for key '/Users/MacPRO-N-GOTO/.ssh/xserver_mg1986jp': mg1986jp-Bitbucket.pub 100% 781 46.2KB/s 00:00 MG-MacBook-Pro:~ MacPRO-N-GOTO$ scp -i ~/.ssh/xserver_mg1986jp -P 10022 ~/.ssh/mg1986jp-Bitbucket mg1986jp@mg1986jp.xsrv.jp:.ssh/ Enter passphrase for key '/Users/MacPRO-N-GOTO/.ssh/xserver_mg1986jp': mg1986jp-Bitbucket 100% 3326 181.7KB/s 00:00
pushができるようにコミットまでしとく。
MG-MacBook-Pro:.ssh MacPRO-N-GOTO$ ssh -l mg1986jp -i ~/.ssh/xserver_mg1986jp -p 10022 mg1986jp.xsrv.jp Enter passphrase for key '/Users/MacPRO-N-GOTO/.ssh/xserver_mg1986jp': Last login: Fri Feb 2 23:16:58 2018 from 39.23.149.210.bf.2iij.net [mg1986jp@sv5015 ~]$ cd scripts/ [mg1986jp@sv5015 scripts]$ git init Initialized empty Git repository in /home/mg1986jp/scripts/.git/ [mg1986jp@sv5015 scripts]$ git config --global user.email "git@xsrv.co.jp" [mg1986jp@sv5015 scripts]$ git config --global user.name "MasayaGoto" [mg1986jp@sv5015 scripts]$ git add clone_execution_and_project_switching.sh [mg1986jp@sv5015 scripts]$ git commit -m "デプロイ用スクリプト" [master (root-commit) 537af12] デプロイ用スクリプト 1 file changed, 236 insertions(+) create mode 100755 clone_execution_and_project_switching.sh [mg1986jp@sv5015 scripts]$ git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # .htaccess.model # clone_execution_and_project_switching.sh.bk nothing added to commit but untracked files present (use "git add" to track) [mg1986jp@sv5015 scripts]$ git remote add origin git@bitbucket.org:mg1986jp/scripts.git [mg1986jp@sv5015 scripts]$ git push origin warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. [mg1986jp@sv5015 scripts]$
コマンドはcheckoutやfetchやmergeはよく使うのでいいのですが、初回セットアップ系は「あれ?どうすんだっけ、、、」ってなります。
GUIは楽ですが慣れすぎると怖いですね。
どこか抜けがありますでしょうか。
とりあえず、非公開リポジトリを作ってそこにpushまでしたいです、、、
今回初めてbitbucket使います。
別に現場で使うわけじゃなくて(というか使ってる現場みたことない)個人でよく依頼を受けるので、保存先どうするかと悩んでいて無料無制限非公開リポジトリが売りのbitbucketを選定しました。
githubの方が慣れてるんですけど、個人依頼なのでチームで作るわけじゃないので、そして、たかだか5$されど5$、、、
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。