yochiyochirb / meetups

81 stars 24 forks source link

第131回 おかむら たけうち いがらし よしかわ #1416

Closed ghost closed 6 years ago

ekrc-1 commented 6 years ago

よろしくお願いします!

ghost commented 6 years ago

git commit -aを初めて知りました。 いつもgit add .してgit commitしてました

ghost commented 6 years ago

既知のファイルの変更を全てコミット「-a, --all」

ekrc-1 commented 6 years ago

-dフラグと異なり、-Dフラグは変更をマージしていなくてもブランチを削除してくれます。

ryotatake commented 6 years ago

commit --amendと--allがどちらも-aを使えるのは、どう使い分けているのでしょうか

ghost commented 6 years ago

Commit contents options -a, --all commit all changed files -i, --include add specified files to index for commit --interactive interactively add files -p, --patch interactively add changes -o, --only commit only specified files -n, --no-verify bypass pre-commit and commit-msg hooks --dry-run show what would be committed --short show status concisely --branch show branch information --porcelain machine-readable output --long show status in long format (default) -z, --null terminate entries with NUL --amend amend previous commit --no-post-rewrite bypass post-rewrite hook -u, --untracked-files[=]

ekrc-1 commented 6 years ago

heroku createしてもローカルに影響はない?

ryotatake commented 6 years ago

git push heroku masterのherokuとmasterは何を表してる?

ghost commented 6 years ago

git push heroku masterが失敗します。。。

admin:~/environment/yochiyochi_app (master) $ git push heroku master
Counting objects: 95, done.
Compressing objects: 100% (81/81), done.
Writing objects: 100% (95/95), 20.99 KiB | 651.00 KiB/s, done.
Total 95 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:                         Detected buildpacks: Ruby,Node.js
remote:                         See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.4.4
remote: -----> Installing dependencies using bundler 1.15.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        
remote:        The dependencies in your gemfile changed
remote:        
remote:        You have added to the Gemfile:
remote:        * jbuilder (= 2.7.0)
remote:        * pg (= 0.20.0)
remote:        
remote:        You have deleted from the Gemfile:
remote:        * jbuilder (= 2.6.4)
remote:        Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        
remote:        The dependencies in your gemfile changed
remote:        
remote:        You have added to the Gemfile:
remote:        * jbuilder (= 2.7.0)
remote:        * pg (= 0.20.0)
remote:        
remote:        You have deleted from the Gemfile:
remote:        * jbuilder (= 2.6.4)
remote: 
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to agile-fortress-94399.
remote: 
To https://git.heroku.com/agile-fortress-94399.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agile-fortress-94399.git'
ekrc-1 commented 6 years ago

Gemfile.lock←実際にインストールしたgemリスト

ghost commented 6 years ago

bundle install --without productionを忘れている

ryotatake commented 6 years ago

1.5.2まで読みました

ghost commented 6 years ago

恐らくheroku createしたあたりで、remotes/heroku/*が出来てる

admin:~/environment/yochiyochi_app/.git (GIT_DIR!) $ cat config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@bitbucket.org:okash1n/yochiyochi_app.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[remote "heroku"]
        url = https://git.heroku.com/agile-fortress-94399.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
ghost commented 6 years ago

gitで複数のリモートレポジトリにpushする方法

origin2を作らなくても、一つのoriginに2つのリポジトリを指定できた

admin:~/environment/yochiyochi_app (master) $ cat .git/config 
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@bitbucket.org:okash1n/yochiyochi_app.git
        url = git@github.com:okash1n/yochiyochi_app.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[remote "heroku"]
        url = https://git.heroku.com/agile-fortress-94399.git
        fetch = +refs/heads/*:refs/remotes/heroku/*

git hubにも草を生やしたい人は是非