LoginSignup
9
14

More than 5 years have passed since last update.

Androidプロジェクトの作成から,Gitのインストール,Githubとの連携までの環境構築手順

Last updated at Posted at 2015-01-12

はじめに

ここではGitのインストール,Androidプロジェクトの作成,Githubに上げるまでの環境構築をご紹介します。

Gitのインストール

まずはサクッとGitのインストール

shell
$ sudo yum install git

Androidプロジェクト作成

次に開発していくプロジェクトを作成
下記サイトを参考にさせて頂きました。有難うございます。
http://techacademy.jp/magazine/3257

Gitの初期化

先ほど作成したAndroidプロジェクトのルートディレクトリにて、下記コマンドでGitの初期化

shell
cd ルートディレクトリ
$ git init

gitignoreの作成

不要なファイル、ディレクトリ省くために.gitignoreを作成

shell
$ vi .gitignore

下記をコピー・アンド・ペースト

.gitignore
#built application filess
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# eclipse settings
.classpath
.project
.settings/

#Mac cache
.DS_Store

ファースト・コミット

不要なファイルを省いたので安心してadd,commit

shell
$ git add .
$ git commit -m 'first commit'

githubにてレポジトリ作成

ここからはブラウザ上での作業になります。
下記リンクからgithubにアクセス
https://github.com/

①githubアカウント作成
下記を参考にさせて頂きました。有難うございます。
http://fnya.cocolog-nifty.com/blog/2014/01/github-185e.html

②レポジトリ新規作成
メニューバーの「+」→「New repository」からレポジトリの新規作成

Shoichi-Kakizaki.png

③ レポジトリ名決定
レポジトリ名を決めてレポジトリの作成

Create_a_New_Repository.png

レポジトリにプッシュ

ターミナルに戻り、下記コマンドで先ほどgithubに作成したリポジトリにプッシュ

shell
$ git remote add origin git@github.com:username/ProjectName.git
$ git push origin master

#エラーが出る場合は下記で試してください
# $ git push -f origin master

以上です。これで安心してAndroidアプリが開発出来そうです

9
14
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
9
14