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 5 years have passed since last update.

git の色々

Last updated at Posted at 2019-08-28

git clone

最初の一回目でremote-repo からlocal-repoに引っ張ってくることが git clone できる
git clone をするとoriginが自動的に作られる。
originはremote-repoの名前。git clone はコミッターが権限を持たないとcloneできない。

fork

他人のremoteリポジトリを自分のremoteリポジトリとしてコピーする。
forkはオープンソースで使われている。例えとして、atomなどがいっぱいforkされて、pullリクエストがとばされている。

git cloneとforkの違いについて

git cloneはgithubなどのリモートリポジトリからURLを引数としてディレクトリをとってくる。こちらはコミッター(URLを発行した人)が権限を渡さなければpushできない。少数のチーム開発に向いている。
対象的にforkはリモートリポジトリが公開されている場合、いろんな人がこのサービスいいなと思ったとする(例えばatomなど)、forkをした人はリモートリポジトリをコピーできる。そこで、新機能などを追加して元のサービスにプルリクエストをおこなう。みんなで新機能を使って盛り上げよう的な!
スクリーンショット 2019-08-30 15.07.15.png

git pull

git pull はfetchとmergeを実行している。
fetchとはremoteリポジトリからlocalリポジトリの間に存在する追跡リポジトリに引っ張ってこれる。

git push

local-repoからremote-repoにpushしている。

git push [リモートリポジトリの名前] [branchname]:[branch]

リモートリポジトリのbranchに、ローカルブランチのbranchnameをプッシュします。

git push origin develop:master

developがローカルブランチ(branchname)、masterがリモートブランチの名前。

git marge

現在のブランチに他のブランチのコミットを吸収すること。

git config --list

git に登録した情報一覧を表示できる。

git rebase

git mergeとの違いがよくわかってません。

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?