GitHub へ初回pushして、ファイル変更して再度push
- 2024.11.19
- DEVELOP

GitHub へリポジトリ作り、ローカルからpushするまで
GItHubへリポジトリ作成。今回はprivate。
dev_privateというリポジトリを作る


ローカル(Windows)より、Git Bashを起動し、作業フォルダを作る。
pwd
/c/work/dev/github
mkdir dev_private
cd dev_private
echo “dev private !!!” > index.html
ローカルでgitセットアップ
git init

ステージングエリアにファイルをあげる
git add .

ステージングエリア→ローカルリポジトリへファイルをあげる
git commit -m “first commit”

git status
ローカルリポジトリ→リモートリポジトリ(GitHub)
git remote add origin https://github.com/saos6/dev_private.git
git push -u origin master

※ここでgithubの認証が聞かれる。初めての場合は。

ファイルを編集して、再度push

git add .

git commit -m “second commit”

git push -u origin master

githubへ再度push完了

改めgit 初期設定を確認と変更
git config -l
git config –global user.name “なまえ”
git config –global user.email “メールアドレス”
その後、再度ファイル変更後に、3回目のpush

git add .
git commit -m “third commit”
git status
git push -u origin master

-
前の記事
EC CUBE 4 でレイアウト変更 2024.11.08
-
次の記事
githubのcodespaces laravel11 VS CODE でtodoアプリづくり 2025.01.06