Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save DianaEromosele/fa228f6f6099a8996d3cb891109ab975 to your computer and use it in GitHub Desktop.

Select an option

Save DianaEromosele/fa228f6f6099a8996d3cb891109ab975 to your computer and use it in GitHub Desktop.
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@helenabjalkovska

Copy link
Copy Markdown

+1

@jayanath

Copy link
Copy Markdown

Thank you! 🚀 🌟

@Marianbc

Copy link
Copy Markdown

simple and sweet. +1

@rivka567

Copy link
Copy Markdown

Thank you!!!!!!!

@cloudFitly

Copy link
Copy Markdown

gracias

@luispablo

Copy link
Copy Markdown

+1

@AdvaithD

Copy link
Copy Markdown

clutch szn

@donbr

donbr commented May 15, 2021

Copy link
Copy Markdown

thanks!

@blumanio

blumanio commented Jun 9, 2021

Copy link
Copy Markdown

+1

@Chloeem

Chloeem commented Jul 31, 2021

Copy link
Copy Markdown

thanks for this!

@rilwansmith

Copy link
Copy Markdown

Can someone explain what each of the commands do?
Thanks.

@ghostdevv

Copy link
Copy Markdown

Wouldn't git remove set-url origin <url> be shorter?

@AlexaderLex

Copy link
Copy Markdown

Thank you! Thank you! Thank you!!!

@balupton

balupton commented Sep 1, 2021

Copy link
Copy Markdown

Wouldn't git remove set-url origin <url> be shorter?

it would be if it worked, however it rarely works for all sorts of reasons (push and fetch urls being different, different branches having different remotes, multiple urls for a single remote)

@ghostdevv

Copy link
Copy Markdown

@bal

Wouldn't git remove set-url origin <url> be shorter?

it would be if it worked, however it rarely works for all sorts of reasons (push and fetch urls being different, different branches having different remotes, multiple urls for a single remote)

Makes sense!

@atattibayev

Copy link
Copy Markdown

Thank you so much! It worked for me as well!

@lung21

lung21 commented Oct 5, 2021

Copy link
Copy Markdown

Thank you for the hint

@jesscarlos

Copy link
Copy Markdown

Wouldn't git remove set-url origin <url> be shorter?

it would be if it worked, however it rarely works for all sorts of reasons (push and fetch urls being different, different branches having different remotes, multiple urls for a single remote)

I think you mean git remote set-url origin <url>

@RenatoLopes771

Copy link
Copy Markdown

+1

what are the last 2 commands for though?

@PrernaWeb

Copy link
Copy Markdown

I left off the last 2 commands, still worked.

@DLesmes

DLesmes commented Nov 19, 2021

Copy link
Copy Markdown

3 years later, thnx x 1k

@cgrant417

Copy link
Copy Markdown

After doing this, github desktop wants me to publish the local copy!?!
If I use
$ git remote set-url origin <remote_url>
I don't run into this problem. They are properly synced.

@Liran-tal

Copy link
Copy Markdown

Thank you. As a noob, it is very helpful to see the simple way things get done.

@mclements

Copy link
Copy Markdown

After GitHub changed the default branch name from master to main, I used:

$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config main.remote origin
$ git config main.merge refs/heads/main

@coolprogrammerarpit007

Copy link
Copy Markdown

ThankYou So Much. This is so helpful

@MatrasTomek

Copy link
Copy Markdown

Thank you! Great help.

@ruicruzeiro

Copy link
Copy Markdown

Beautiful! Thank you so much!

@MaloJay

MaloJay commented Jan 14, 2023

Copy link
Copy Markdown

thanks, this helped alot..

@rcapdepaula

Copy link
Copy Markdown

thanks!

ghost commented May 16, 2023

Copy link
Copy Markdown

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment