repositoryとは

直訳すると「倉庫」。
プロジェクトの各種コード等を管理する「倉庫」。
​1 プロジェクト = 1 倉庫 = 1 repository

 

repository作成後のターミナル操作

ローカルディレクトリを設定する

mkdir /path/to/your/project

パスを指定してフォルダ(ディレクトリ)を作成する。

 

cd /path/to/your/project

そのディレクトリへ移動する。

 

git init

Gitで「指定したディレクトリ」をイニシャライズ。

(ここのディレクトリをGit管理にしますよ!と設定する。)

 

git remote add origin https://UserName@bitbucket.org/UserName/test.git

Gitで「remote」側に「origin」として「http〜」を指定する。

(ここがリモート側の大元ですよ!と設定する。)

 

最初のファイルを作成し、コミット、プッシュしてください。

echo "Hello World" >> contributors.txt

contributors.txtファイルを作成して、

ファイル内に"Hello World"とテキストを入力する。

 

*ここで一つ、重要な概念を記載する。

ローカルからリモートにデータを上げる時の順序は、

 

「add」→「commit」→「push」

 

となる。

 

git add contributors.txt

git commit -m "Initial commit with contributors"

git push -u origin master