Skip to content

Commit 816447a

Browse files
committed
Force proper remote url
1 parent d9e15e2 commit 816447a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

bin/github-backup

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ def fetch_repository(name, remote_url, local_dir, skip_existing=False):
617617

618618
if clone_exists:
619619
log_info('Updating {0} in {1}'.format(name, local_dir))
620+
git_command = ['git', 'remote', 'rm', 'origin']
621+
logging_subprocess(git_command, None, cwd=local_dir)
622+
git_command = ['git', 'remote', 'add', 'origin', remote_url]
623+
logging_subprocess(git_command, None, cwd=local_dir)
620624
git_command = ['git', 'fetch', '--all', '--tags', '--prune']
621625
logging_subprocess(git_command, None, cwd=local_dir)
622626
else:

0 commit comments

Comments
 (0)