0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

github forkして開発

Posted at

自分のアカウントにログインしてfork

他人のリポジトリを自分のギットハブ上(remote)のリポジトリにコピー

自分のローカルにコピー

git clone でコピー
.gitファイルはcloneしたフォルダに備わっているためどこのフォルダでcloneしても問題ないがおすすめはこんな感じ
github.com/ユーザー名/ここにclone

ソース修正・コミット前にやること

自分とローカルリポジトリの状態をチェック

$ git config -l
-------
user.email=
user.name=

ここに自分のデータが入っていないと共同開発者(同僚や友達)との間でこのコミット誰だ〜とわからなくなってしまうので要注意

作業ブランチを作成

ブランチは開発の規模や社内ルールでそこそこ変わる。
なので最初は「トピックブランチ(ないしフィーチャーブランチ)の命名規則はありますか?」
と聞いてみるのがおすすめ。
基本的にはこんなかんじでブランチを着ればOK
「【ユーザー名】/【ソース修正理由】」

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

$ git checkout -b dainabe/add_readme origin/master
Branch 'dainabe/add_readme' set up to track remote branch 'master' 
from 'origin'.
Switched to a new branch 'dainabe/add_readme'

$ git branch
* dainabe/add_readme
  master

今回はmasterからローカルにブランチを切っているが`dev'ブランチからのほうが多いかも!!

ソース修正〜GitHub反映

ローカル環境でソース修正

まずは自分のローカルにあるデータが問題ないか確認

$ git status
On branch dainabe/add_readme
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

nothing to commit, working tree clean
が確認できたら早速修正。
ここからはいつもの流れ

git add 
git commit
git push -u origin リモートに作成するブランチ名
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?