LoginSignup
5
6

More than 3 years have passed since last update.

【Xcode】プロジェクトをGitHubにあげる手順

Last updated at Posted at 2021-01-16

はじめに

この記事にはXcodeでプロジェクトを作成するところから、GitHubにプロジェクトをあげるところまでまとめました。
⚠️当方初学のため認識違いがある可能性大です
誤りを見つけた際はコメントにて指摘していただけると幸いです🙇‍♀️🙇‍♂️

前提

・GitHubのアカウントを持っている
・ターミナルにgitをインストールしている
・ターミナル(git)にて初期設定が完了している

環境

・git version 2.24.3
・macbookpro 16inch (2019)
・Xcode Version 12.3 (12C33)

目次

1.Xcodeでプロジェクトの作成
2.GitHubでリポジトリの作成
3.ターミナルでGitHubのリポジトリにPush

1.Xcodeでプロジェクトの作成

1スクリーンショット 2021-01-16 2.44.47.png
はじめにXcodeにて新しくプロジェクトを作成します。
Create a new Xcode project を選択

2スクリーンショット 2021-01-16 2.45.30.png
iOS→Appを選択し、Next

3スクリーンショット 2021-01-16 2.46.04.png
poduct Name: TestApp
Team: 任意
Organization Identifier: 任意
Bundle Identifier: 任意
Interface: Storyboad
Life Cycle: UIKit App Delegate
Language: Swift
→Next
(プロジェクト自体は触らないので今回ここはなんでもいいです)

4スクリーンショット 2021-01-16 2.55.45.png
任意のフォルダを選択し、Create
※ Create Git repository on my Mac は選択しない

5スクリーンショット 2021-01-16 2.56.38.png
こうなればOK

2.GitHubでリポジトリの作成

6スクリーンショット 2021-01-16 2.58.05.png
GitHubでログインし、初期画面の左上にある緑色のNewをクリック

7スクリーンショット 2021-01-16 2.59.21.png
Ownerを自身に選択し(任意)、Repository nameにTestAppと入力(任意)し,
緑色のCreate repositoryをクリック
※チェックボックスはどれも選択しない

8スクリーンショット 2021-01-16 3.01.25.png
こうなればOK

3.ターミナルでGitHubのリポジトリにPush

9スクリーンショット 2021-01-16 3.04.28.png
ターミナルを開き、
cd
と入力し、Xcode上のTestApp(黄色いフォルダのアイコン)をターミナル上へドラッグ&ドロップしてEnter

10スクリーンショット 2021-01-16 3.06.56.png
git init と入力しEnter

11スクリーンショット 2021-01-16 3.09.25.png
git add .と入力しEnter

12スクリーンショット 2021-01-16 3.24.08.png
git commit -m "first commit"と入力しEnter
(""の中は任意)

13スクリーンショット 2021-01-16 3.24.43.png
git branch -M mainと入力しEnter

14スクリーンショット 2021-01-16 3.25.10.png
↓の画像の赤枠の箇所を打ち込む(コピペ)

18スクリーンショット 2021-01-16 3.01.25のコピー.png

15スクリーンショット 2021-01-16 3.25.27.png
git push -u origin mainと入力しEnter

16スクリーンショット 2021-01-16 3.25.42.png

17スクリーンショット 2021-01-16 3.26.59.png
GitHubのrepositoryのページを更新し、こうなっていればOK

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6