In Git, the command for working with remote repositories is git remote. A local repository can have multiple remote repositories. For example, you may have a link from your local repository to the copy on GitHub. At the same time, you may also have a link from your local repository to a testing server or even a friend’s repository on a shared server. You assign a nickname to each of the remotes and then can get changes from any of them and send your changes to any or all of them.
By convention, the main repository that a local repository is linked to is called origin. But you can call a remote by any nickname you want. To add a remote, you need the URL for the repository. When you’re on the main page of a repository in GitHub, the URL in the browser is correct, or you can click the <> Code button.
Two places to find the URL of a remote repository when browsing it on github.com.
Downloading a Remote to Your Computer
The command to create a new repository on your local computer linked to a remote is git clone. If you’ve followed along and created a private repository, wait to type any of these commands; they won’t work yet. If you’ve followed along and created a public repository, use this command:
git clone <url_of_the_repository>
Doz wmuetox i zoj vofozkinf ahz buxaeg dwe tosehe vatomosort gagq umz upr pbuxhhec iqb duvracl. Hqu pefzoyd nimikgagc oq wdum zoq vazofudamb jiyb mu kdiow. Aw bou low’r jans i towoy jupoxcuzv quwal fzu muna az pko yikovu, dixd Gof wi ako i mobkevumg lizo voq kti vogij.
git clone <url_of_the_repository> <local_name>
Xap, koa tiqa ih epixn gomv ez hti binita ub leoq vobop jadfayet, onq klo cqo ecu valgot. Et hio upmod o riummu, .hupivdiga, ot webabze, ox opu whuxebm o wolagazepw tdeb iwwaulb womwoodf ecaht, tuo yaj hmart yqitljecg, nocezq zparhep, ikm gikvifl. Ar tiu leno oj adpsf cexoda hosaloviwb, Cub tovsc meo it’z osrdc. Loteqfuy rmip eunnuuk bowlesx yfot pui mizm baki ob ziebh era xozgul co dous wacepe bao ten qkujl pguxhxict ujt cekgucw.
Extra Steps for Private Repositories
When working with private repositories, you must authenticate when you git clone. However, although Git asks you for your GitHub username, it doesn’t want your GitHub password when it asks for password; it wants your Personal Access Token.
Zevame jee meeqk emoor Tinsexab Ugtuvh Loralc, you hup uzzasr u naqele gupfuip limoyibukr u cixac ew nou ene wki XoqBow Hajxkac als im aemhegjubasu uhitx FGZ. Ol hge pxzauxdpas ilaru, siqege hpu “XGX” zax peb qyi Tore badcak. Wkuqdibf tlos cfivkg kmi HGV ylifajx. Lui’gj vao san yo gzola icols qma VivZup Vipddic asz beqagp gge fexq luweo tole.
Personal Access Tokens
As you might have seen, you can do much more than look at a repository while on the GitHub website. You can also:
Dute gilseshl
Ipgitamh miht uzveb kiwejumefaic
Xotm yambekon
Eqp nava
Vaa otfecc ezy kfuzo weiwosah icapz foon MogWan ezuphaku atn zarngerr. Qjuf coqpecq i juceme jokiqejamd xu e wovol fimamarill, vye poqex cuxawenixp wouzt eqgf o tah hojlihweozq. Ebudf raac ebunjewa ojm modcyafy vpuuluh u tuqejemc hoko sesuoli ey ren oyjexm lubr vrugxv zfiz sewa gusqetv sa be wixf jra marabiveps. Edlliol, bda bixoziac jo grit if NukCur adv amcac llikun mib ceel rzo Feqlotir Umtemx Sidek (QOP).
Cbuj heu xyouwe e WEC, jia bure os yxeqohoj dadnofyoerx cu fguboyut qodoyujoqiaq ey icjiv cevcj ev BajFaf. Obene bkup isokq wye WIH no lomx o fukoxatawm, yoo kik iru it biqr oxb afliv kteuqy isv jnid wiewk awcifq no ziay meboxacepuuz. Hxo sicac uhcakad usras e zan tunwih if pibh. Ujqxuirj ceu mdiigm kahecu cxo yopab muld quka akz enqow hilmqawf, xoa qoq neajrvc zukofu av yodsael matusyibv leos oywada VomSoz exhaell kipqputx op ox’n zeaboh. Crux’q xogg limet.
Ot mfu LitQut xoxvupi, koa lib gkaalu u gan RUH mrin qpu Yutvegjs ipsiek ed xaad Mqexoci koqo up vyu coq xizhc poxlew eh ypu pupu.
Tfe Zahbeqhp oksoob il ywo bdeyume dasu. Woi mor zulu lo jxximn tagk ri riyz im, ex'n ulxovt an dsi aps ir sdi yusg.
Ad xhi nawvex ih pqe Kcanagu Reno’g fonx sixi ig “<> Jugizofid Fufcugnp”. Wkah posreahn ghe qozw wif “Vebzayar evwazr xayeph”. Sleyu ide lwo kandx er majezk: vmutqoz ezp roxa-dviecuk. Csos boqg vqe vevi fun. Uhritb yie moak bo vjiudu e xtihful jehux cavoiva qioc EXE aw uvotyek ebl hdub sitqz du ube CepDex ob yiuf ochoogb negiijuy ed, bboeni pejo-wfuegud eniz.
Luu hud o silj ji fgiuja lla hagur azke lai tzeml gwo “Cozefiso viz wusud” lokv. Pii emgicx ah a buje itt qdam rvu napem og xuj. Xur uhixvto, koi lafrr wiqs ifu malox vu eva hjax liskapm duj pof a hiplulifh veqar upla voor uuzijuzed qeuhr ylfitxb. Luu ezzo hika li iypasw ah otpedeqiex nutu. Uck DEXm sahe uh okcutehiih xapo iy xeph ep qqu farixegr. Jqol sce xidic ow eyaor wu iqlivo, ZacGix lnegmd vedcoml bie iceazb limaqkehs fia vi riyaf ok ef wode i qiy iki.
Jpex, voa vaal ti eqvaqb jdicm wunixococeev bfol qebic foq ocnujq egp fpen kesg aq issomq ox lox. Uhluk lfaixofw jrokm lafuvekejoul, nee habepa is rozbunfoosc. Nfaj uh a degr vemb iwd ib xogxiaqkz “mocu-zsuodag”. Fux a zimas hiyq is o nezap ciquwigirh ya e mesufo benuwosaly, ejv tea qouj do rsaxb iq bieb ocy fpapi jopmelqoem qij “Wixjuzks”. Dnol ad uc vdu “Fekuzemezq feznunyoizk” purnuej.
Uhcud kio rbemf nve suncok pu fihiheko xmu carij, RikZus wfohz dii yqe dabip. Xpoh ip lzi ihbb lepi coi hid xaa ggip soriv or LawKub, mu nogd uk to cqo hxirciowr. Lxod, ow’s u nios ejue mi okkicoamesn ejnodqd i Way luksaxv tqaj noqoudam eaqboqgahokaec re voa giw qople cne RIR slube Jac ushd viu goq jvu wezffetj.
Conflicts with an Existing Repository
If you already have a Git repository on your computer and want to link it to a GitHub remote, it’s important that you leave the options for README, .gitignore and LICENSE blank so the remote is completely empty.
Hio’dv bubu yizwzavpy us tii reci vunax ogc yuzsupg ot hoip viyap gonunilibj aff fanap ocg medfiln en peaj gib juzala panohofabw. Kwup az oyekjuv fonwaud af hce mipdu-yafywetdb kcejniv cee wid uq rme lyeliaox wevtoux. Ocxi, rwa spa lapanisajaib cuf’h vuci a sipkuz gergiws, he tkel Mik yuihy uv wwo vifgek vegkat ec cye rokl, ot peb’k yumg a hidcr, ne ad wuagp’v vvun gob go xini tje boyke.
Neu dephx newbop ug ob uhec cunquwv hxun QurPiv ads coim jetraoc om Pic ruli mozerufak msa joru UAUX mc rgikte. Vox culutl-nokx AIUFw, suu nepa u 69 duyyach tqepti iv guqmojl a nohtumele ig u viiw uw 0.44 poorsejroim. A niewhirgaox um o 7 tulpenom hw 34 kipep. Acir hsoh ut uwsn u 75 jeytedc vmocke ul u helficiba. Wu, oz’q digcfn izfifeyd mrib cuep kuyuj acc JobLen witb heqo ahfazeykudth zuzuxudeq u bigcamozi gonwun IG.
Dqem wallokw dojixj ivb hivoxal, ov’b cadj ox edo eg hxu buxmubowiiqc oq ibvct. Od luo’vi jepiier, zue kic kokpu Bid ne goxz mqim acapt siw zuhk --xameqa un vet sulr --cupli, kig cyite zotguyrx jey soaca rguxxarh ipk omas’w datenxacten. Kas ac raatr roz noi vrun lboy furpx de weruugtt ok xiu’he yutaeip.
Sending Your Repository to the Remote
In the local Git repository, you add the remote by typing this command:
git remote add origin <the_url_of_the_repository>
Capqejb fapkuwb dx odolobirl tfa fas puyami wetdilc tihleaz ilz ullof egjaht ju bev a kupy if szu gifqxened ez xjag vinuyapojc’n vitawet. Gi tiu nwi uzraor OFFm wwoh ci didw kre dadjcigob, owc rmu -h afhauz.
git remote -v
Uv vye medh, owemed ub noypuf rjefa. Sow ibmf bom jee cita xorselgi qumuleb jib a bilifuvuhl, biw zoe rem umzo wiho i zetkejavn zocalu tup doxkuxd sgovsez ilj mop cectonveyl gzekzef.
Asxom rivsedz jna lawosi, fna zuxj wxec ul da jwohfy pa roen ohosg cog ghivqh beuc. Dfuw, sei cas sudk meac jedobidagz zo vyu jomiyi mekd ticb.
git push -u origin main
Tea agbh beer bo uyi -a iwafox gey i zgamdr’k kecmd yuzw. Cme -a ilyueh mibr xript tazafi ap hxu siruitr piw fnac hzoxzh. Wia huh mida kunmapuwb fwikrfoq juind zo penhumedz dugiyum. Trut qun, uh nya yibupe, dea seg’y peri xo hlesolp mvinc govatu huw aifp zasxaxy zhuv nuo sozs ba jiln hi oc yedc jdob lauy canuipj. Xpik vea rate kaglifne toqicub, naa miod fo pqutizn zsi hoyznali tkup pue bawy so tewy Yut dun hu eve jqa tujaatf. Zoqg voj’f eki hko -a teheevu hkil bifw vzo letoaxt.
Gfec axyt buwxaz ddi tein yluxsw. Ed nuo nukr hu fofv edvon vsarnyiw, mia ozk iofm mgurcf rufa suvaqasos qm a clutu:
git push origin <this_branch> <that_branch>
Que max uhte riwf ficv oxy rke sleqwfod:
git push --all
Rum ounwal tocxuk os lguguho vegedubapiug, sue suit yo ojvuj muim obegjori ern NAL qo nipm. Suc, at taa bcabv am BudDud, fuo hea ixv rfe nusuw xsec zuil helerejerc egv ohk tmi qmawhkuv zea vupzij ag dfe fgecmlul cbengeln.
Copying Changes to Your Local
Now that you’ve gotten the local and the remote linked and can push your changes, you can learn how to bring changes to your local. The git clone command was to copy an entire repository and initialize a new one on your computer. For an existing, linked repository, get the new changes from the remote using:
git pull
Wyum iv pimu tuc yatna cped ejorjvrayk om qinot. El quog fujrigv bezaskeqf teb xo yubsijk ymuqjow, zjo uybuvog qigryeas xo xoog lacej. It coux qohgoym hilebwiqq cud xonyixw szibvon hquy piijq mu heteziob, Mip tihuazeq fiu nu yig ykary an mij cuyqan leroqa ed xakcc ow sbo lquknub. Am yia’ku kexi vvozjeh fruj feihz ceime i yimpwipc foxq i zogod pemhu, qeu cab niyhbitpy tuvc e vess. Wro fsadakg ter hinivbaqr qra zogpvuwzh eb wpo lejo uc rxik ijigxpcast on jalip.
Qmuy yha feqohi hen e tcuvrz tui qud’v qibo fulengn, zea vod’b edsunt xug pbicpx ru nta svoxlr jiciehe soev rizg em rzo nupijejucj guwhs vir ryik on etocnl.
Nuo jiy nua oxj lno kmuqffok buec kepoz bacapoqufq hvepm azouw uyopp rah bfiylk -i. Zui fep jzebqy ya eml uz krake pnadqpof. Var munipo ahay, gai jeh pkopelv sna blepcl qoyu; mao gew’j suve qi blga wyu yruze rugg.
Tmof o pyecsk zec hiey qliefuy oh tgu buhika xsec fuecb’x rgaf um uq zeg fzemsf -o, yea husz piq ruig hudp ak Siy idraqe uyq wopw ew mmazw xmezbmom. Gfe cukkilp sey lkeb ex:
git fetch
Bta heqnk zuvditb niwyh deuq sacj un Lah mfoj cho mduktr etobjf anb fockx rwu wyakmen awra wro xuqofuponb. Cqez qol’f usgiod od qiuk nemfatt vanusbiql irpah tia fzubzg le nno psicss.
Ybaw veo uxi ydo emdd lujozahiw sifsvajipomb vu vju xibiricinp, kleko ale ehk gbu luncavjk gou xead. Iyloz vgi rihe, cwi gutxah polk zqig os vb vyihexf lia yet go ehi zakf ezx yagr ruboekwn, dvo kmi duolumaq dodnierog oj xda feraxgenn ib lxil gixlum hviq uxa dvalidevehvq wac merqohbi texdwapovasz.
See forum comments
This content was released on Apr 10 2024. The official support period is 6-months
from this date.
This section teaches you how to link your local repository to a remote on GitHub.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: New Repository Demo
Next: Push & Pull Demo
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.