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

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

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

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

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

解決済

1回答

1415閲覧

githubにcreate-react-appで作成したrepositoryが反映されません

jpskgc

総合スコア19

Git

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

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

0クリップ

投稿2019/07/23 09:37

編集2019/07/23 12:35

前提・実現したいこと

主にgoとreactからなるファイル群をgithubにあげようとしています
githubにfirst commitしたのですが、create-react-appで作成したファイル群がgithubではアクセスできません。
このreactのファイル群もgithubでほかと同様に正常にアップロードしたいです。

article
├ api
│ └ main.go
└ client
. └ create-react-appで作成された諸々のreactコンテンツ
イメージ説明

試したこと

最初にgit add .したところ、以下のような警告が出ました

command

1$ git add . 2warning: adding embedded git repository: client 3hint: You've added another git repository inside your current repository. 4hint: Clones of the outer repository will not contain the contents of 5hint: the embedded repository and will not know how to obtain it. 6hint: If you meant to add a submodule, use: 7hint: 8hint: git submodule add <url> client 9hint: 10hint: If you added this path by mistake, you can remove it from the 11hint: index with: 12hint: 13hint: git rm --cached client 14hint: 15hint: See "git help submodule" for more information.

次に以下のコマンドを打ちましたが、git add時のエラーは解決しませんでした。

command

1$ git rm --cached client 2error: the following file has staged content different from both the 3file and the HEAD: 4 client 5(use -f to force removal) 6$ git rm --cached client -f 7rm 'client'

次に以下のようにclientの.gitを削除したところ、git add時のエラーは解消されました。
しかしcommit&pushした結果として、clientフォルダ以下のreactパッケージがgithubに反映されていません。

command

1$ rm -rf client/.git

以上お手数ですが、ご教授いただけると幸いです。よろしくお願いいたします。

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

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

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

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

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

og24715

2019/07/23 12:12

react と go 関係ないのでタグ外したほうがいいかもしれないですね。
guest

回答1

0

自己解決

stackoverflowに同じ質問をして回答を得ました。
以下のコマンドを実行して解決しました。

mv client subfolder_tmp git submodule deinit client git rm --cached client mv subfolder_tmp client git add client

投稿2019/07/23 12:08

jpskgc

総合スコア19

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問