Tag: git push

对于Ruby on Rails项目拉取请求,git push to my fork失败

我做了修复和测试, git commit -a ,更新了我的分支,现在我正在尝试推送到我之前做过的GitHub分支: vagrant@rails-dev-box:~/rails$ git push mine my_fix Username for ‘https://github.com’: myusername Password for ‘https://myusername@github.com’: To https://github.com/myusername/rails.git ! [rejected] my_fix -> my_fix (non-fast-forward) error: failed to push some refs to ‘https://github.com/myusername/rails.git’ To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg ‘git pull’) before pushing again. See the […]

推出Heroku,json和ruby 1.9.2时出错

我在推送Heroku时遇到问题,请按照以下错误进行操作 —–> Gemfile detected, running Bundler version 1.0.7 Unresolved dependencies detected; Installing… Using –without development:test Fetching source index for http://rubygems.org/ Installing rake (0.9.2) Installing abstract (1.0.0) Installing activesupport (3.0.9) Installing builder (2.1.2) Installing i18n (0.5.0) Installing activemodel (3.0.9) Installing erubis (2.6.6) Installing rack (1.2.3) Installing rack-mount (0.6.14) Installing rack-test (0.5.7) Installing tzinfo (0.3.29) Installing actionpack […]

在Git中编写一个预推钩来grep所有文件的正则表达式想要拒绝push如果找不到正则表达式

我有以下预推钩。 理想情况下,如果任何文件的内容与顶部定义的正则表达式不匹配,我希望它能够遍历所有被推送到我的存储库的文件并拒绝推送。 尝试循环遍历文件时,我收到以下错误:“undefined method` each’for”“:String(NoMethodError)”。 ‘.each’不起作用,因为git命令返回包含已更改文件的字符串。 #!/usr/bin/env ruby regex = “\\s*GO\\s*$” localRef, remoteRef = ARGV #puts localRef #puts remoteRef input = $stdin.readlines[0] localSha = input.split(” “)[1] remoteSha = input.split(” “)[3] #puts localSha #puts remoteSha range = “#{remoteSha}..#{localSha}” #folderPath = `git rev-parse –show-toplevel` #puts folderPath `git diff –name-only –diff-filter=ACMR #{range}`.each do |file| #puts file content = […]