Skip to content

Commit 6699a6d

Browse files
committed
OTWO-4267 Workaround to resolve 'git push fails:refusing to update checked out branch'
1 parent 1af22dc commit 6699a6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/ohloh_scm/adapters/git/push.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def push(to)
1010

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

0 commit comments

Comments
 (0)