Closed ghost closed 6 years ago
git commit -a
を初めて知りました。
いつもgit add .
してgit commit
してました
-dフラグと異なり、-Dフラグは変更をマージしていなくてもブランチを削除してくれます。
commit --amendと--allがどちらも-aを使えるのは、どう使い分けているのでしょうか
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[=
heroku createしてもローカルに影響はない?
git push heroku masterのherokuとmasterは何を表してる?
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'
Gemfile.lock←実際にインストールしたgemリスト
bundle install --without production
を忘れている
1.5.2まで読みました
恐らく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/*
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にも草を生やしたい人は是非
よろしくお願いします!