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

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

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

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Git

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

Webサイト

一つのドメイン上に存在するWebページの集合体をWebサイトと呼びます。

GitHub

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

Q&A

解決済

1回答

1132閲覧

コミット名が何なのかわかりません。

kageyama_tobio

総合スコア18

Django

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Git

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

Webサイト

一つのドメイン上に存在するWebページの集合体をWebサイトと呼びます。

GitHub

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

0グッド

0クリップ

投稿2020/10/08 12:44

編集2020/10/08 13:34

djangogirlsのチュートリアルをやっているのですが、
下のサイト画像の下方、Pythonanywhere-command-lineで入力した時git pullと
入力すると下のエラーが返されてしまいました。
そこでリンク内容を参考に解決しようとしたのですが、
コミット名と自分の作業ブランチが何のことなのかわかりません。教えて下さい。

djangogirlsに沿って行った動作

commandline

1C:\Users\ユーザー名>cd djangogirls 2 3C:\Users\ユーザー名\djangogirls>git status 4On branch master 5Your branch is up to date with 'origin/master'. 6 7nothing to commit, working tree clean 8 9C:\Users\ユーザー名\djangogirls>git add --all 10 11C:\Users\ユーザー名\djangogirls>git status 12On branch master 13Your branch is up to date with 'origin/master'. 14 15nothing to commit, working tree clean 16 17C:\Users\ユーザー名\djangogirls>git commit -m "Modified templates to display posts from database." 18On branch master 19Your branch is up to date with 'origin/master'. 20 21nothing to commit, working tree clean 22 23C:\Users\ユーザー名\djangogirls>git push 24Everything up-to-date 25 26C:\Users\ユーザー名\djangogirls>

エラー文

pythonanyweherecommand

1error: Your local changes to the following files would be overwritten by merge: 2 db.sqlite3 3 mysite/settings.py 4Please, commit your changes or stash them before you can merge.

djangogirls

イメージ説明

djangogirlsリンク内容

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

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

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

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

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

m.ts10806

2020/10/08 12:48

自身でGitリポジトリ作ったのではないですか? 参考先はあくまで参考先なのであなた自身がやった手順を確認、記載してください。
kageyama_tobio

2020/10/08 12:59

commandlineで行った動作を追加しました。
takutakuya

2020/10/08 13:14

「リンク内容」にアクセスできません。
m.ts10806

2020/10/08 13:15

>Your branch is up to date with 'origin/master'. なので、 git pull origin master かと思うのですが如何でしょうか。
m.ts10806

2020/10/08 13:21

URLはコピペが基本ですね https[:] ←抜けてます
m.ts10806

2020/10/08 21:39

じゃあ、同期はできてますね。 特に問題なしです。
guest

回答1

0

ベストアンサー

git add --allの後の . が抜けているのが気になりますね。
あとmater→mainにgithubの側の名前が変わってしまったのでそれも影響しているかもしれないです。
https://qiita.com/ryo_1241/items/22a6a4ca4838f2b79ee1
こちらの記事の対処方法を試してみては如何でしょうか。

git push origin 自分の作業ブランチ の部分は
git push origin origin main(かmaster)
になります。

投稿2020/10/09 00:16

yasutakatou

総合スコア446

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

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

kageyama_tobio

2020/10/09 00:49

解答ありがとうございます。 そのサイトに出ているコミット名には何を入力すれば良いですか。
yasutakatou

2020/10/09 01:03

説明不足でしたね、お手数おかけしてすみません。元の git commit -m "Modified templates to display posts from database." のままで良いと思います。 コミット名はメモみたいなものなので、何じゃないとエラーみたいなものではないので元のままでいきましょう
kageyama_tobio

2020/10/09 01:52

入力したところ次のように返ってきました。 *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: empty ident name (for <kageyama7190@8e86bfb0e784>) not allowed
yasutakatou

2020/10/09 02:42

「githubに登録した際のメールアドレスとアカウント名をコンフィグに登録してね」というメッセージです。 github登録時の情報を git config --global user.email "you@example.com" git config --global user.name "Your Name" こちらの"の間に書いて実行してみてください。
kageyama_tobio

2020/10/09 04:03

下記の通り返されました Config file location --global use global config file --system use system config file --local use repository config file -f, --file <file> use given config file --blob <blob-id> read config from given blob object Action --get get value: name [value-regex] --get-all get all values: key [value-regex] --get-regexp get values for regexp: name-regex [value-regex] --get-urlmatch get value specific for the URL: section[.var] URL --replace-all replace all matching variables: name value [value_regex] --add add a new variable: name value --unset remove a variable: name [value-regex] --unset-all remove all matches: name [value-regex] --rename-section rename section: old-name new-name --remove-section remove a section: name -l, --list list all -e, --edit open an editor --get-color find the color configured: slot [default] --get-colorbool find the color setting: slot [stdout-is-tty] Type --bool value is "true" or "false" --int value is decimal number --bool-or-int value is --bool or --int --path value is a path (file or directory name) Other -z, --null terminate values with NUL byte --name-only show variable names only --includes respect include directives on lookup
yasutakatou

2020/10/09 04:11

git config --global user.email "you@example.com" git config --global user.name "Your Name" このまま実行されてませんか?"you@example.com"と"Your Name"はgith登録時の メールアドレスとアカウント名に置き換えないとエラーになりますよ。 もし置き換えたうえで上記メッセージならどう実行されたかを記載頂けないでしょうか。
kageyama_tobio

2020/10/09 04:27

1つ1つ分けて実行したのですが、何も返しがなかったので、まとめて入力し先程の返しが来ました。 03:40 ~/kageyama7190.pythonanywhere.com (master)$ git config --global user.email "メールアドレス" git config --global user.name "ユーザー名"
yasutakatou

2020/10/09 05:15

Unixのコマンドは返答が無いのは正常動作の時が多いです。(不親切ですがそういうものですので。。) なので分けて実行した時点でコマンドは通った可能性が高いです。 よって、私が最初に回答した内容を参考に最初からやり直して見てください。 今度はうまくいくことを祈っております!
kageyama_tobio

2020/10/09 14:02

遅くなってすいません。 改めて一通りやってみて 「git add --all .」の点にも気おつけ、 pythonanywhereでのgit pullで今まで違う返しが来ました。 [command prompt] C:\Users\ユーザー名>git status fatal: not a git repository (or any of the parent directories): .git C:\Users\ユーザー名>cd djangogirls C:\Users\ユーザー名\djangogirls>git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean C:\Users\ユーザー名\djangogirls>git add --all . C:\Users\ユーザー名\djangogirls>git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean C:\Users\ユーザー名\djangogirls>git commit -m "Modified templates to display posts from database." On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean C:\Users\ユーザー名\djangogirls>git push Everything up-to-date [pythonanywhere] 13:06 ~ $ cd kageyama7190.pythonanywhere.com 13:12 ~/kageyama7190.pythonanywhere.com (master)$ git pull warning: Cannot merge binary files: db.sqlite3 (HEAD vs. ff269b960321 4118eeacb9b9d9619a26146541a7) Auto-merging mysite/settings.py CONFLICT (content): Merge conflict in mysite/settings.py Auto-merging db.sqlite3 CONFLICT (content): Merge conflict in db.sqlite3 Automatic merge failed; fix conflicts and then commit the result. 13:14 ~/kageyama7190.pythonanywhere.com (master)$ git add * 13:15 ~/kageyama7190.pythonanywhere.com (master)$ git commit -m "Modi es to display posts from database." [master 164ea3c] Modified templates to display posts from database. 13:16 ~/kageyama7190.pythonanywhere.com (master)$ git push origin mas origin master Username for 'https://github.com': kageyama0917 Password for 'https://kageyama0917@github.com': fatal: refs/remotes/origin/HEAD cannot be resolved to branch. 13:19 ~/kageyama7190.pythonanywhere.com (master)$ git pull Already up-to-date. ウェブサイトではこのように表示されていました。 このウェブサイトは、オンラインホスティング環境であるPythonAnywhereによってホストされています。ロードしようとしたときに問題が発生しました。後でもう一度やり直してください。
yasutakatou

2020/10/09 14:17

なんでconflictになるか分からないとこなんですが、今のgit状態が 消えても良いなら -f をつけて強制的にpushすればconflictは解消できます。 https://gotohayato.com/content/445/ 残したいファイルのコミットをご確認の上、実施ください
kageyama_tobio

2020/10/09 14:34

このような返しが来ました。 14:05 ~/kageyama7190.pythonanywhere.com (master)$ git pull -f Already up-to-date.
kageyama_tobio

2020/10/09 23:28

サイトを開いてみたのですが、だめでした。。
yasutakatou

2020/10/10 00:28

pullじゃなくてpushですね。 もし学習するお時間あるのであれば、一旦リポジトリを消して最初からやり直した方が学びになると思いますよ。ツギハギで解決してきたことがスッキリ覚え直しできるかと思います。
kageyama_tobio

2020/10/10 03:39

わかりました。 後々これ以上に苦労しそうなので、もう一度djangogirlsやり直してみます。 ここまでありがとうございました!
yasutakatou

2020/10/10 03:53

お手数おかけしてすみません。ただ、やり直すことで価値のある学習になると思いますよ。同じハマりももう起きなさそうですし。次はうまくいくこと祈ってますよ!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問