Skip to content

Commit

Permalink
OTWO-4267 Workaround to resolve 'git push fails:refusing to update ch…
Browse files Browse the repository at this point in the history
…ecked out branch'
  • Loading branch information
aruncsengr committed Jun 10, 2016
1 parent 1af22dc commit 6699a6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ohloh_scm/adapters/git/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ def push(to)

if to.exist?
ENV['GIT_COMMITTER_NAME'] = COMMITTER_NAME
run "cd '#{to.url}' && git checkout -b tmp"
run "cd '#{self.url}' && git push '#{to.url}' #{self.branch_name}:#{to.branch_name}"
run "cd '#{to.url}' && git checkout master && git branch -d tmp"
else
if to.local?
# Create a new repo on the same local machine. Just use existing pull code in reverse.
Expand Down

0 comments on commit 6699a6d

Please sign in to comment.