プロジェクトGit管理:Github連携

◽️作成プロジェクトGit管理とGithub連携

  1. git管理するプロジェクトDIR(movie_app_cit007)移動
  2. local git 初期化(git init)
  3. github.comからrepository作成(remote origin)
  4. local gitのremote origin repository設定(git remote add origin http://xxx)
  5. local git管理対象ファイルの指定(git add .)
  6. local git内容をgithub remote origin(master branch)へ反映
$ cd movie_app_cit007
$ git init
Initialized empty Git repository in /Users/intackcho/Documents/movie_app_cit007/.git/
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitignore
	README.md
	package-lock.json
	package.json
	public/
	src/

nothing added to commit but untracked files present (use "git add" to track)
$ 

◽️githubから作成したrepository連携(git remote add origin https://)

$ git remote add origin https://github.com/cit007/movie_app_cit007
$ git add .
$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   .gitignore
	new file:   README.md
	new file:   package-lock.json
	new file:   package.json
	new file:   public/favicon.ico
	new file:   public/index.html
	new file:   public/logo192.png
	new file:   public/logo512.png
	new file:   public/manifest.json
	new file:   public/robots.txt
	new file:   src/App.css
	new file:   src/App.js
	new file:   src/App.test.js
	new file:   src/index.css
	new file:   src/index.js
	new file:   src/logo.svg
	new file:   src/serviceWorker.js
	new file:   src/setupTests.js

$ git commit -m "cit007 movie example"
[master (root-commit) d2b5731] cit007 movie example
 18 files changed, 14389 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 README.md
 create mode 100644 package-lock.json
 create mode 100644 package.json
 create mode 100644 public/favicon.ico
 create mode 100644 public/index.html
 create mode 100644 public/logo192.png
 create mode 100644 public/logo512.png
 create mode 100644 public/manifest.json
 create mode 100644 public/robots.txt
 create mode 100644 src/App.css
 create mode 100644 src/App.js
 create mode 100644 src/App.test.js
 create mode 100644 src/index.css
 create mode 100644 src/index.js
 create mode 100644 src/logo.svg
 create mode 100644 src/serviceWorker.js
 create mode 100644 src/setupTests.js

$ git push origin master
Username for 'https://github.com': cit007
Password for 'https://cit007@github.com': 
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 171.65 KiB | 3.99 MiB/s, done.
Total 22 (delta 0), reused 0 (delta 0)
remote: 
remote: Create a pull request for 'master' on GitHub by visiting:
remote:      https://github.com/cit007/movie_app_cit007/pull/new/master
remote: 
To https://github.com/cit007/movie_app_cit007
 * [new branch]      master -> master

$ git branch status
$ git branch -a
* master
  status
  remotes/origin/master
$ 

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です