Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@JhonatanHern

This comment has been minimized.

Copy link

@JhonatanHern JhonatanHern commented Sep 3, 2018

this is useful

@stevanpopo

This comment has been minimized.

Copy link

@stevanpopo stevanpopo commented Sep 5, 2018

+1. This was helpful. Thanks.

@diazwatson

This comment has been minimized.

Copy link

@diazwatson diazwatson commented Sep 10, 2018

+1

@hodispk

This comment has been minimized.

Copy link

@hodispk hodispk commented Sep 14, 2018

Great job.

@dailyworker

This comment has been minimized.

Copy link

@dailyworker dailyworker commented Sep 22, 2018

+1

@rimusz

This comment has been minimized.

Copy link

@rimusz rimusz commented Sep 25, 2018

+1

@BellatorInMachina

This comment has been minimized.

Copy link

@BellatorInMachina BellatorInMachina commented Sep 25, 2018

+1

@rahuliyer96

This comment has been minimized.

Copy link

@rahuliyer96 rahuliyer96 commented Oct 3, 2018

Can anyone explain how this differs from a "git remote set-url new_origin" ?

@westerdaled

This comment has been minimized.

Copy link

@westerdaled westerdaled commented Oct 8, 2018

Ditto @rahuliyer96 as ultimately we setting or unsetting the git config.

@zer0id0

This comment has been minimized.

Copy link

@zer0id0 zer0id0 commented Oct 11, 2018

thanks

@thecodingaviator

This comment has been minimized.

Copy link

@thecodingaviator thecodingaviator commented Oct 15, 2018

Thank you :)

@talweiss1982

This comment has been minimized.

Copy link

@talweiss1982 talweiss1982 commented Oct 17, 2018

+1

@Volksfeld

This comment has been minimized.

Copy link

@Volksfeld Volksfeld commented Oct 17, 2018

+1

@emiviada

This comment has been minimized.

Copy link

@emiviada emiviada commented Oct 26, 2018

+1

@drupallerina

This comment has been minimized.

Copy link

@drupallerina drupallerina commented Oct 31, 2018

Thanks 👍

@Anton6896

This comment has been minimized.

Copy link

@Anton6896 Anton6896 commented Nov 3, 2018

Thanks a lot +1

@artfisica

This comment has been minimized.

Copy link

@artfisica artfisica commented Nov 19, 2018

+1

@micas06gua

This comment has been minimized.

Copy link

@micas06gua micas06gua commented Nov 21, 2018

Thanks! +1

@gjorgjevski

This comment has been minimized.

Copy link

@gjorgjevski gjorgjevski commented Nov 22, 2018

Thanks!!! :)

@DavidChhing

This comment has been minimized.

Copy link

@DavidChhing DavidChhing commented Nov 30, 2018

This worked. Thanks!

@Talref

This comment has been minimized.

Copy link

@Talref Talref commented Dec 5, 2018

Clear and concise, thanks!

@Titowisk

This comment has been minimized.

Copy link

@Titowisk Titowisk commented Dec 6, 2018

It helped me, thanks!

@doblesesays

This comment has been minimized.

Copy link

@doblesesays doblesesays commented Dec 6, 2018

Thanks, +1

@opeabdul

This comment has been minimized.

Copy link

@opeabdul opeabdul commented Dec 7, 2018

This was helpful, thanks.

@wangjiafenghw

This comment has been minimized.

Copy link

@wangjiafenghw wangjiafenghw commented Dec 10, 2018

+1

@mahmood-sajjadi

This comment has been minimized.

Copy link

@mahmood-sajjadi mahmood-sajjadi commented Dec 11, 2018

Thanks, it is very useful

@karthik-raghavendra

This comment has been minimized.

Copy link

@karthik-raghavendra karthik-raghavendra commented Dec 13, 2018

+1

@urbain4

This comment has been minimized.

Copy link

@urbain4 urbain4 commented Dec 28, 2018

thx body

@j2pb

This comment has been minimized.

Copy link

@j2pb j2pb commented Dec 29, 2018

thx mate!

@damian123

This comment has been minimized.

Copy link

@damian123 damian123 commented Jan 7, 2019

Works!

@vicovictor

This comment has been minimized.

Copy link

@vicovictor vicovictor commented Jan 8, 2019

Looks like everyone needs this because Github is offering free unlimited private repo. lol

@laurettemhlanga

This comment has been minimized.

Copy link

@laurettemhlanga laurettemhlanga commented Jan 16, 2019

Thank you

@eumirollarvez

This comment has been minimized.

Copy link

@eumirollarvez eumirollarvez commented Jan 20, 2019

Thank you!!!!

@dpunish3r

This comment has been minimized.

Copy link

@dpunish3r dpunish3r commented Feb 1, 2019

Thanks! +1

@jasonzdeng

This comment has been minimized.

Copy link

@jasonzdeng jasonzdeng commented Feb 11, 2019

Thanks!

@DiegoArrieta

This comment has been minimized.

Copy link

@DiegoArrieta DiegoArrieta commented Feb 12, 2019

+1

@AcheZeta

This comment has been minimized.

Copy link

@AcheZeta AcheZeta commented Feb 28, 2019

Awesome!!

@MarinaSenko

This comment has been minimized.

Copy link

@MarinaSenko MarinaSenko commented Mar 2, 2019

Thanks!

@Shubhayu-Das

This comment has been minimized.

Copy link

@Shubhayu-Das Shubhayu-Das commented Mar 6, 2019

+1. Thanks a lot!

@GreedyAsF

This comment has been minimized.

Copy link

@GreedyAsF GreedyAsF commented Mar 11, 2019

+1 you're a life saver

@epiekarski6666

This comment has been minimized.

Copy link

@epiekarski6666 epiekarski6666 commented Mar 13, 2019

+1

@orimazrafi

This comment has been minimized.

Copy link

@orimazrafi orimazrafi commented Mar 19, 2019

wow,that's fixed everything! thank you

@Prooffreader

This comment has been minimized.

Copy link

@Prooffreader Prooffreader commented Mar 31, 2019

+1 This would have taken me forever to figure out

@Shnatta

This comment has been minimized.

Copy link

@Shnatta Shnatta commented Mar 31, 2019

+1 Thanks man

@astro8891

This comment has been minimized.

Copy link

@astro8891 astro8891 commented Apr 6, 2019

Awesome! +1

@sryvcr

This comment has been minimized.

Copy link

@sryvcr sryvcr commented Apr 8, 2019

Thank you!! +1

@antoinebourlart

This comment has been minimized.

Copy link

@antoinebourlart antoinebourlart commented Apr 24, 2019

+1, thank you :)

@JulianSchnehage

This comment has been minimized.

Copy link

@JulianSchnehage JulianSchnehage commented May 6, 2019

+1 Thank you :)

@igorpeixoto

This comment has been minimized.

Copy link

@igorpeixoto igorpeixoto commented May 15, 2019

+1 indeed

@sskenner

This comment has been minimized.

Copy link

@sskenner sskenner commented May 17, 2019

+1 still helping folks yrs later.. thx

@chazza144

This comment has been minimized.

Copy link

@chazza144 chazza144 commented May 21, 2019

yay thanks!

@jacobcoccari

This comment has been minimized.

Copy link

@jacobcoccari jacobcoccari commented May 22, 2019

Really easy to follow.

@sgerodes

This comment has been minimized.

Copy link

@sgerodes sgerodes commented May 23, 2019

Thank you very much!

@sedkis

This comment has been minimized.

Copy link

@sedkis sedkis commented Jun 2, 2019

+1

@lGatl

This comment has been minimized.

Copy link

@lGatl lGatl commented Jun 5, 2019

Merciiiiiiiiii !!!!!!!!

@esker

This comment has been minimized.

Copy link

@esker esker commented Jun 5, 2019

+1 x 10^1000000000

@moghwan

This comment has been minimized.

Copy link

@moghwan moghwan commented Jun 6, 2019

+10

@rodrigordgfs

This comment has been minimized.

Copy link

@rodrigordgfs rodrigordgfs commented Jun 7, 2019

While (True) {
print(+1)
}

@dudeisbrendan03

This comment has been minimized.

Copy link

@dudeisbrendan03 dudeisbrendan03 commented Jun 8, 2019

while True:
     print("+1")
@maxime-beck

This comment has been minimized.

Copy link

@maxime-beck maxime-beck commented Jun 12, 2019

Perfect, thank you :)

@Rey810

This comment has been minimized.

Copy link

@Rey810 Rey810 commented Jun 12, 2019

Thanks! Just what I was looking for.

@hugocfranco

This comment has been minimized.

Copy link

@hugocfranco hugocfranco commented Jun 13, 2019

print("Thanks!")
print ("+1")

@matheussantana

This comment has been minimized.

Copy link

@matheussantana matheussantana commented Jun 13, 2019

+1

@lucas11776

This comment has been minimized.

Copy link

@lucas11776 lucas11776 commented Jun 21, 2019

$i = 0;
echo ++$i;

@kosaikham

This comment has been minimized.

Copy link

@kosaikham kosaikham commented Jun 25, 2019

+1

@jdecode

This comment has been minimized.

Copy link

@jdecode jdecode commented Jul 9, 2019

+1

@CatherineSharon12

This comment has been minimized.

Copy link

@CatherineSharon12 CatherineSharon12 commented Jul 18, 2019

+1 thank you!

@frdylmz

This comment has been minimized.

Copy link

@frdylmz frdylmz commented Jul 24, 2019

Thank you.......

@seyonechithrananda

This comment has been minimized.

Copy link

@seyonechithrananda seyonechithrananda commented Aug 6, 2019

Thanks!

@cooldevil007

This comment has been minimized.

Copy link

@cooldevil007 cooldevil007 commented Aug 12, 2019

Thanks worked like a charm ....

@swasgrafx

This comment has been minimized.

Copy link

@swasgrafx swasgrafx commented Aug 16, 2019

+1 Worked. Already put to good use! Thanks

@bartoszlokaj

This comment has been minimized.

Copy link

@bartoszlokaj bartoszlokaj commented Sep 3, 2019

Thanks! Really helpful :)

@eduardoalvara2

This comment has been minimized.

Copy link

@eduardoalvara2 eduardoalvara2 commented Sep 11, 2019

Gracias! Thank you! +1

@richardbalwane

This comment has been minimized.

Copy link

@richardbalwane richardbalwane commented Sep 21, 2019

Merci... Webale Inho! Thank you. Urakoze Kyane...

@yhenni1989

This comment has been minimized.

Copy link

@yhenni1989 yhenni1989 commented Sep 23, 2019

amazing. Good Job

@kmozsi

This comment has been minimized.

Copy link

@kmozsi kmozsi commented Oct 10, 2019

Thank you!!

@papa28x4

This comment has been minimized.

Copy link

@papa28x4 papa28x4 commented Oct 20, 2019

Thank you

@RadiactiveJesus

This comment has been minimized.

Copy link

@RadiactiveJesus RadiactiveJesus commented Oct 29, 2019

+1

@netlander

This comment has been minimized.

Copy link

@netlander netlander commented Nov 2, 2019

+1

@bigimot22

This comment has been minimized.

Copy link

@bigimot22 bigimot22 commented Nov 6, 2019

+1

@africlubguy

This comment has been minimized.

Copy link

@africlubguy africlubguy commented Nov 10, 2019

Asante sana. Very helpful

@Speeddymon

This comment has been minimized.

Copy link

@Speeddymon Speeddymon commented Nov 16, 2019

Thank you. This was helpful for me as well. I was able to change my remote and then I was able to push from local master to remote branch with git push origin master:remotebranchthatisntmaster after that I was able to git checkout remotebranchthatisntmaster and I can proceed with making additional changes and committing to the correct location.

@chrismjohnston

This comment has been minimized.

Copy link

@chrismjohnston chrismjohnston commented Nov 19, 2019

Thanks so much for this

@SavSanta

This comment has been minimized.

Copy link

@SavSanta SavSanta commented Nov 26, 2019

I had to additionally do a git branch --set-upstream-to=<origin/master> <my_local_master> since I just forked the repo but had a bunch of commits that needed to be done to the forked repo that had been done locally. Thank you

@oguzhandalgic

This comment has been minimized.

Copy link

@oguzhandalgic oguzhandalgic commented Dec 8, 2019

+1

@thebigbluetree

This comment has been minimized.

Copy link

@thebigbluetree thebigbluetree commented Dec 9, 2019

+1

@armanarco

This comment has been minimized.

Copy link

@armanarco armanarco commented Dec 9, 2019

Thank you. I've been stuck for 3hours looking for this :D

@Mikapedia

This comment has been minimized.

Copy link

@Mikapedia Mikapedia commented Dec 14, 2019

+1

@rkraghu88

This comment has been minimized.

Copy link

@rkraghu88 rkraghu88 commented Dec 21, 2019

Thanks. Works like a charm!!

@mohammadameer

This comment has been minimized.

Copy link

@mohammadameer mohammadameer commented Dec 23, 2019

thanks +1

@Ioanad-A

This comment has been minimized.

Copy link

@Ioanad-A Ioanad-A commented Jan 3, 2020

thank you +1

@MavenOfCode

This comment has been minimized.

Copy link

@MavenOfCode MavenOfCode commented Jan 7, 2020

Thank you!

@raquelhortab

This comment has been minimized.

Copy link

@raquelhortab raquelhortab commented Jan 9, 2020

Thanks!

@godwin-broadshift

This comment has been minimized.

Copy link

@godwin-broadshift godwin-broadshift commented Jan 20, 2020

+1

@kubilayciftci

This comment has been minimized.

Copy link

@kubilayciftci kubilayciftci commented Jan 23, 2020

Thanks!

@vfrancov

This comment has been minimized.

Copy link

@vfrancov vfrancov commented Jan 23, 2020

great! +1

@gsmangasil

This comment has been minimized.

Copy link

@gsmangasil gsmangasil commented Feb 4, 2020

thanks

@catarinavclemente

This comment has been minimized.

Copy link

@catarinavclemente catarinavclemente commented Feb 4, 2020

Thanks for this, Diana!!!

@greensmurph

This comment has been minimized.

Copy link

@greensmurph greensmurph commented Feb 7, 2020

Love it. Ty!

@hi2rashid

This comment has been minimized.

Copy link

@hi2rashid hi2rashid commented Feb 16, 2020

If its Private Repo, then

git remote set-url origin https://username@github.com/organizationname/reponame.git

Note: If you restructured the Git organization, Make sure you have read write permission to the repo.

ssh -vT git@github.com (Do not change git@ to your Username https://help.github.com/en/github/authenticating-to-github/error-permission-denied-publickey)

@anushka-beri

This comment has been minimized.

Copy link

@anushka-beri anushka-beri commented Feb 23, 2020

+1. Thanks.

@tjzango

This comment has been minimized.

Copy link

@tjzango tjzango commented Mar 1, 2020

+1. Thanks.

@softeip

This comment has been minimized.

Copy link

@softeip softeip commented Mar 3, 2020

+1 Thanks

@djcaesar9114

This comment has been minimized.

Copy link

@djcaesar9114 djcaesar9114 commented Mar 10, 2020

Very useful. Thanks.

@brando90

This comment has been minimized.

Copy link

@brando90 brando90 commented Mar 13, 2020

why do u need the last two commands?

@us0906

This comment has been minimized.

Copy link

@us0906 us0906 commented Mar 21, 2020

thanks. This helped me a lot!

@normarth

This comment has been minimized.

Copy link

@normarth normarth commented Mar 22, 2020

Simply perfect

@Benny56

This comment has been minimized.

Copy link

@Benny56 Benny56 commented Mar 24, 2020

Thanks a lot

@Ezeky

This comment has been minimized.

Copy link

@Ezeky Ezeky commented Mar 28, 2020

Thx

@Upward-Spiral

This comment has been minimized.

Copy link

@Upward-Spiral Upward-Spiral commented Mar 29, 2020

Short, simple and useful! Thanks!

@AmirBikchentaev

This comment has been minimized.

Copy link

@AmirBikchentaev AmirBikchentaev commented Apr 1, 2020

thanks brotha

@pragmatist2015

This comment has been minimized.

Copy link

@pragmatist2015 pragmatist2015 commented Apr 3, 2020

Thank you for sharing your experience.

@Sola-BG

This comment has been minimized.

Copy link

@Sola-BG Sola-BG commented Apr 3, 2020

Good stuff

@elenasss

This comment has been minimized.

Copy link

@elenasss elenasss commented Apr 7, 2020

great, thank you

@Yoncity

This comment has been minimized.

Copy link

@Yoncity Yoncity commented Apr 8, 2020

Great help

@dino68

This comment has been minimized.

Copy link

@dino68 dino68 commented Apr 13, 2020

Still works, bless

@lesstuck

This comment has been minimized.

Copy link

@lesstuck lesstuck commented Apr 21, 2020

Thank you.

@anii76

This comment has been minimized.

Copy link

@anii76 anii76 commented Apr 29, 2020

+1

@JJCoen

This comment has been minimized.

Copy link

@JJCoen JJCoen commented May 13, 2020

Thanks Diana

@alekcz

This comment has been minimized.

Copy link

@alekcz alekcz commented May 18, 2020

👍

@JuanSevillano

This comment has been minimized.

Copy link

@JuanSevillano JuanSevillano commented Jun 7, 2020

Great! thank you

@silped1022

This comment has been minimized.

Copy link

@silped1022 silped1022 commented Jun 9, 2020

+1. Thanks.

@alexnas

This comment has been minimized.

Copy link

@alexnas alexnas commented Jun 13, 2020

+100 Thanks!

@isy-creates

This comment has been minimized.

Copy link

@isy-creates isy-creates commented Jun 14, 2020

+1. Thank you!

@frankkode

This comment has been minimized.

Copy link

@frankkode frankkode commented Jun 16, 2020

useful thanks

@codewarrior4

This comment has been minimized.

Copy link

@codewarrior4 codewarrior4 commented Jun 21, 2020

thank you very much

@PortfolioDavidStump

This comment has been minimized.

Copy link

@PortfolioDavidStump PortfolioDavidStump commented Jun 24, 2020

Very helpful - Thanks very much.

@cristianvogel

This comment has been minimized.

Copy link

@cristianvogel cristianvogel commented Jul 8, 2020

thanks!

@SeanKier

This comment has been minimized.

Copy link

@SeanKier SeanKier commented Jul 9, 2020

👍 💯

@LilyaBu

This comment has been minimized.

Copy link

@LilyaBu LilyaBu commented Jul 30, 2020

Thanks

@Eugene-dev225

This comment has been minimized.

Copy link

@Eugene-dev225 Eugene-dev225 commented Aug 3, 2020

Gr8

@natasha-zz

This comment has been minimized.

Copy link

@natasha-zz natasha-zz commented Aug 18, 2020

Thanks!

@dubesoftware

This comment has been minimized.

Copy link

@dubesoftware dubesoftware commented Sep 1, 2020

Thank you :)

@mdebartolomeo

This comment has been minimized.

Copy link

@mdebartolomeo mdebartolomeo commented Sep 24, 2020

Thanks!

@mary0316

This comment has been minimized.

Copy link

@mary0316 mary0316 commented Sep 25, 2020

thanks~~

@kristiantorres

This comment has been minimized.

Copy link

@kristiantorres kristiantorres commented Sep 28, 2020

What does the last command do (i.e. git config master.merge refs/heads/master)?
Thanks!

@mrwks11

This comment has been minimized.

Copy link

@mrwks11 mrwks11 commented Sep 29, 2020

Thank you!

@sroui

This comment has been minimized.

Copy link

@sroui sroui commented Oct 1, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.