[GitHub]初期設定とアップロードレポート
GitHub Repositoryの作成
Repositoriesへ
Repositoryの作成
Repository nameを入力します.
Public:外部ユーザの表示を許可する
Private:表示のみ
Add a README file

gitのインストール
https://git-scm.com/downloads
gitインストールを検証するには、コマンドプロンプト(cmd)でgit-versionを作成して検証します.
初期設定の2つの方法
方法1:Repositoryを必要なフォルダにダウンロードする
方法2:現在のフォルダをRepositoryにアップロードする
必要なフォルダにRepositoryをダウンロード
ダウンロードするフォルダに移動:
> d:
> cd D:\project
github repositoryの取得
> git clone https://github.com/hj-yu-code/test_rep.git
git clone(gitアドレス):githubリポジトリを現在のフォルダの場所にダウンロード
現在のフォルダをRepositoryにアップロード
アップロードするフォルダに移動:
> d:
> cd D:\test_local
git initの使用
> git init
gitステータスのチェック
> git status // 작성 안해도 가능
git status:現在のフォルダのgit状態を確認する
On branch master // 현재 있는 Branch : master
No commits yet // commits 된 내용 없음
Untracked files: // git 에 올라가지 않은 파일 및 변경된 파일
(use "git add <file>..." to include in what will be committed)
first.txt
nothing added to commit but untracked files present (use "git add" to track)
gitの追加
> git add .
> git status // 작성 안해도 가능
git add . : すべてのファイルをアップロード
git add first.txt : first.txtファイルのみアップロード
On branch master
No commits yet
Changes to be committed: // 올린 예정인 파일
(use "git rm --cached <file>..." to unstage)
new file: first.txt
コミットgit
> git commit -m "init 하고 파일 올리기"
> git status // 작성 안해도 가능
git commit-m「メッセージ」:追加したすべてのファイルをコミット
On branch main
nothing to commit, working tree clean // 모든 파일이 commit되어 있음
gitブランチ名の変更
> git branch // 작성 안해도 가능
> git branch -M main
> git branch // 작성 안해도 가능
git branch:現在のブランチ名を確認する
git branch-v:現在のbranch名と最後のコミットメッセージを確認
git branch-a:すべてのブランチ名をチェック
git branch-m main:現在のブランチ名をmainに変更(デフォルト:master)
git branch-m main master:プライマリブランチ名をmainに変更
githubは、最初にブランチを作成したときにmasterブランチです.
しかし、米国のBlacklives matter運動の延長により、default branchの名前はmaster-slaveのmasterを連想させるのではなくmainに変更された.
https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/
接続github
> git remote -v // 작성 안해도 가능
> git remote add origin https://github.com/hj-yu-code/test_rep.git
> git remote -v // 작성 안해도 가능
git remote-v:現在接続されている外部リポジトリを確認する
git remote add origin(gitアドレス):githubリポジトリを現在のフォルダの外部リポジトリに接続する
方法1:Repositoryを必要なフォルダにダウンロードする
方法2:現在のフォルダをRepositoryにアップロードする
必要なフォルダにRepositoryをダウンロード
ダウンロードするフォルダに移動:

> d:
> cd D:\project

github repositoryの取得

> git clone https://github.com/hj-yu-code/test_rep.git
git clone(gitアドレス):githubリポジトリを現在のフォルダの場所にダウンロード

現在のフォルダをRepositoryにアップロード
アップロードするフォルダに移動:

> d:
> cd D:\test_local

git initの使用
> git init


gitステータスのチェック
> git status // 작성 안해도 가능
git status:現在のフォルダのgit状態を確認する
On branch master // 현재 있는 Branch : master
No commits yet // commits 된 내용 없음
Untracked files: // git 에 올라가지 않은 파일 및 변경된 파일
(use "git add <file>..." to include in what will be committed)
first.txt
nothing added to commit but untracked files present (use "git add" to track)
gitの追加
> git add .
> git status // 작성 안해도 가능
git add . : すべてのファイルをアップロードgit add first.txt : first.txtファイルのみアップロード

On branch master
No commits yet
Changes to be committed: // 올린 예정인 파일
(use "git rm --cached <file>..." to unstage)
new file: first.txt
コミットgit
> git commit -m "init 하고 파일 올리기"
> git status // 작성 안해도 가능
git commit-m「メッセージ」:追加したすべてのファイルをコミット
On branch main
nothing to commit, working tree clean // 모든 파일이 commit되어 있음
gitブランチ名の変更
> git branch // 작성 안해도 가능
> git branch -M main
> git branch // 작성 안해도 가능
git branch:現在のブランチ名を確認するgit branch-v:現在のbranch名と最後のコミットメッセージを確認
git branch-a:すべてのブランチ名をチェック
git branch-m main:現在のブランチ名をmainに変更(デフォルト:master)
git branch-m main master:プライマリブランチ名をmainに変更

githubは、最初にブランチを作成したときにmasterブランチです.
しかし、米国のBlacklives matter運動の延長により、default branchの名前はmaster-slaveのmasterを連想させるのではなくmainに変更された.
https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/
接続github
> git remote -v // 작성 안해도 가능
> git remote add origin https://github.com/hj-yu-code/test_rep.git
> git remote -v // 작성 안해도 가능
git remote-v:現在接続されている外部リポジトリを確認するgit remote add origin(gitアドレス):githubリポジトリを現在のフォルダの外部リポジトリに接続する


gitの抽出とプッシュ
> git status // 작성 안해도 가능
> git pull origin main // README가 없다면 작성 안해도 가능
> git status // 작성 안해도 가능
> git push -u origin main
> git status // 작성 안해도 가능
git pull origin main:外部ストレージ(origin)の内容を現在のブランチ(main)に追加git push-u origin main:現在のブランチ(main)を外部ストレージ(origin)にアップロード

D:\test_local>git status
On branch main // 현재 있는 branch : main
nothing to commit, working tree clean
D:\test_local>git pull origin main
fatal: couldn't find remote ref main // README가 없으므로 아무것도 가져오지 않음
D:\test_local>git push -u origin main
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 256 bytes | 256.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/hj-yu-code/test_rep.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'. // 업로드 완료
D:\test_local>git status
On branch main
Your branch is up to date with 'origin/main'. // 외부 저장소와 같은 상태
nothing to commit, working tree clean

変更されたファイルgithubのアップロード
github関連フォルダに移動:
>d:
>cd D:\project\test_rep
gitの追加
> git add .
コミットgit
> git commit -m "수정사항 업로드"
プッシュgit
> git push -u origin main
Reference
この問題について([GitHub]初期設定とアップロードレポート), 我々は、より多くの情報をここで見つけました
https://velog.io/@hj-yu-code/GitHub-init
テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol
>d:
>cd D:\project\test_rep
> git add .
> git commit -m "수정사항 업로드"
> git push -u origin main
Reference
この問題について([GitHub]初期設定とアップロードレポート), 我々は、より多くの情報をここで見つけました https://velog.io/@hj-yu-code/GitHub-initテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol