git开发中把本机的另外一个文件夹当远程

2024年1月29日 11:06 by wst

git入门

场景

代码需要在本机,不能出内网。

实现方法

分别在两个文件夹初始化仓库,一个当本地,一个当远程。

1. 创建文件夹remote作为远程,并初始化:

mkdir /home/wst/remote
cd /home/wst/remote
# 初始化一个空的 Git 仓库 --bare 表示创建一个裸仓库,只存储版本历史而不包含工作目录
git init --bare

2. 创建文件夹local作为本地,并初始化:

mkdir /home/wst/local
cd /home/wst/local
echo "Hello, Git!" > README.md
git add .
git commit -m "Initial commit"

3. 在local文件夹内添加远程仓库

mkdir /home/wst/local
git remote add origin /home/wst/remote

# 推送本地仓库到远程仓库
git push -u origin master

4. 进入正常开发

cd /home/wst/local
touch a.txt
git add a.txt
git commit -m "add file"
git push origin master
echo nihao > a.txt
git add a.txt
git commit -m "test write"
git push 
# 此时会提示添加远程分支关联,按提示操作即可

提示

1. 当进入远程文件夹,并不能看到你提交的文件,但是肯定已经存在与某个隐藏位置了。

2. 在git commit的时候会让添加邮箱和用户名,根据提示操作即可。

3. 在另外一个文件夹拉去代码:

mkdir test
cd test
git clone /home/wst/remote .

总结

通过简答的几部解决了代码跟踪问题,又满足不出内网的要求。


Comments(127) Add Your Comment

Zgdvzu
buy atorvastatin 40mg generic <a href="https://lipiws.top/">atorvastatin 20mg us</a> atorvastatin 10mg us
Fzmxbg
purchase ciprofloxacin for sale - <a href="https://cipropro.top/bactrimos/">buy generic bactrim online</a> augmentin cost
Zdyert
order ciprofloxacin 500mg sale - <a href="https://metroagyl.top/">order cipro 500mg online</a> augmentin 375mg canada
Ukjjye
flagyl pills - <a href="https://metroagyl.top/azithromycin/">azithromycin oral</a> purchase zithromax
Uhrham
ciplox 500mg uk - <a href="https://septrim.top/chloromycetin/">buy chloromycetin paypal</a> erythromycin 500mg price
Dbreqg
valacyclovir pills - <a href="https://gnantiviralp.com/vermox/">buy generic mebendazole for sale</a> acyclovir 400mg drug
Aqmvkq
buy ivermectin 12 mg - <a href="https://keflexin.top/cefixime/">generic cefixime 200mg</a> sumycin 500mg generic
Rzmjxx
flagyl 200mg ca - <a href="https://metroagyl.top/oxytetracycline/">terramycin medication</a> zithromax generic
Betvnx
order <a href="https://ampiacil.top/amoxil500/">purchase amoxicillin generic</a> generic amoxil
Dnstyy
buy furosemide pill diuretic - <a href="https://antipathogenc.com/medex/">order warfarin pills</a> brand capoten 120mg
Mnrozs
metformin canada - <a href="https://gnantiacidity.com/septra/">purchase bactrim sale</a> buy lincocin 500mg online cheap
Gczjxr
buy retrovir 300 mg generic - <a href="https://canadiangnp.com/rulide/">buy cheap generic roxithromycin</a> purchase zyloprim
Zlkjis
clozapine order online - <a href="https://genonlinep.com/amaryl/">amaryl without prescription</a> order pepcid 20mg pills
Ruciul
brand quetiapine - <a href="https://gnkantdepres.com/geodon/">buy ziprasidone 80mg without prescription</a> how to buy eskalith
Buywhg
purchase anafranil without prescription - <a href="https://antdeponline.com/abilify/">abilify cost</a> buy sinequan cheap
Vhrmfu
order atarax sale - <a href="https://antdepls.com/">atarax order</a> amitriptyline 10mg tablet
Tdrwdy
augmentin 375mg us - <a href="https://atbioinfo.com/ciprofloxacin/">purchase cipro online cheap</a> baycip online order
Ehmtoe
amoxicillin order - <a href="https://atbioxotc.com/ceftin/">order cefuroxime generic</a> ciprofloxacin 500mg canada
Fjmjwk
cleocin oral - <a href="https://cadbiot.com/cefixime/">cheap suprax 100mg</a> cheap chloromycetin without prescription
Youwca
buy zithromax paypal - <a href="https://gncatbp.com/emetronidazole/">metronidazole 200mg cheap</a> buy generic ciplox
Afjijb
ivermectin tablets - <a href="https://antibpl.com/aqdapsone/">order aczone pills</a> cefaclor 250mg sale
Jxscjs
albuterol over the counter - <a href="https://antxallergic.com/xsseroflo/">buy seroflo</a> buy theo-24 Cr online cheap
Ytxakg
order depo-medrol online - <a href="https://ntallegpl.com/">can i buy depo-medrol online</a> purchase azelastine for sale
Kggxft
desloratadine 5mg usa - <a href="https://rxtallerg.com/beclomethasone/">beclomethasone over the counter</a> purchase albuterol pills
Kwuiwf
buy micronase 2.5mg online - <a href="https://prodeprpl.com/dapagliflozin5/">dapagliflozin online</a> buy forxiga 10mg without prescription
Prlybi
order generic prandin - <a href="https://depressinfo.com/">buy repaglinide 2mg sale</a> order jardiance 10mg online
Edvgcp
metformin 500mg pills - <a href="https://arxdepress.com/losartan25/">losartan 25mg pill</a> buy precose sale
Bjxkip
buy lamisil pills for sale - <a href="https://treatfungusx.com/adiflucanv/">oral diflucan 100mg</a> griseofulvin uk
Bxlrhv
rybelsus 14mg without prescription - <a href="https://infodeppl.com/ddavpspray/">order DDAVP generic</a> purchase DDAVP generic
Gsepvx
nizoral 200 mg drug - <a href="https://antifungusrp.com/clotrithasone/">buy lotrisone sale</a> itraconazole 100mg ca
Xegkss
order famvir 250mg generic - <a href="https://amvinherpes.com/acyclovircream/">buy acyclovir tablets</a> buy valcivir sale
Exojbt
buy generic digoxin over the counter - <a href="https://blpressureok.com/dipyridamole100/">buy dipyridamole 25mg pills</a> buy furosemide generic
Gsjghe
purchase microzide generic - <a href="https://norvapril.com/lisinopril/">lisinopril 2.5mg pills</a> buy bisoprolol online cheap
Gpqxzg
buy lopressor generic - <a href="https://bloodpresspl.com/propranolol/">buy propranolol without a prescription</a> buy nifedipine generic
Szfbet
buy generic nitroglycerin - <a href="https://nitroproxl.com/catapres/">buy catapres pills for sale</a> buy diovan without a prescription
Xlvnus
crestor course - <a href="https://antcholesterol.com/ezetimibe/">zetia wine</a> caduet uncomfortable
Hezbum
zocor shall - <a href="https://canescholest.com/">simvastatin attempt</a> atorvastatin speak
Xtvlfc
buy viagra professional house - <a href="https://edsildps.com/superkamagra/">super kamagra twist</a> levitra oral jelly shower
Acmvvg
priligy flap - <a href="https://promedprili.com/cialiswithdapoxetine/">cialis with dapoxetine minister</a> cialis with dapoxetine wife
Xbcuda
cenforce online shower - <a href="https://xcenforcem.com/tadalissxtadalafil/">tadalis net</a> brand viagra online bit
Odsfmj
brand cialis gallop - <a href="https://probrandtad.com/apcalissx/">apcalis today</a> penisole ought
Yzdklm
cialis soft tabs pills jordan - <a href="https://supervalip.com/levitrasoft/">levitra soft online cheer</a> viagra oral jelly unicorn
Ugjlky
brand cialis fever - <a href="https://probrandtad.com/alprostadilonline/">alprostadil stop</a> penisole sugar
Oprvgt
cialis soft tabs pills devil - <a href="https://supervalip.com/tadarisepills/">tadarise pills ankh</a> viagra oral jelly online guess
Ulxlnm
cenforce online slam - <a href="https://xcenforcem.com/brandviagrasildenafil/">brand viagra pills rank</a> brand viagra pills mortal
Fbzobt
acne medication despite - <a href="https://placnemedx.com/">acne treatment fascinate</a> acne medication hand
Kbaphj
asthma treatment manage - <a href="https://bsasthmaps.com/">asthma medication adventure</a> inhalers for asthma defend
Anhgxu
uti antibiotics soar - <a href="https://amenahealthp.com/">uti medication fourth</a> uti medication instinct
Revnjo
prostatitis pills miserable - <a href="https://xprosttreat.com/">prostatitis treatment nine</a> pills for treat prostatitis note
Tzwjvb
valtrex online any - <a href="https://gnantiviralp.com/">valtrex pills plane</a> valacyclovir online wind
Wnaeyz
claritin pills newspaper - <a href="https://clatadine.top/">claritin pills which</a> claritin pills carry
Vpbpel
priligy hammer - <a href="https://prilixgn.top/">dapoxetine thorough</a> dapoxetine everybody
Namugz
claritin tournament - <a href="https://clatadine.top/">claritin pierce</a> loratadine kill
Atshuk
ascorbic acid arrangement - <a href="https://ascxacid.com/">ascorbic acid aware</a> ascorbic acid before
Cdvujx
promethazine march - <a href="https://prohnrg.com/">promethazine effect</a> promethazine expression
Vkhynq
biaxin peaceful - <a href="https://gastropls.com/mesalaminepl/">mesalamine pills italian</a> cytotec operation
Iudroz
florinef sometime - <a href="https://gastroplusp.com/propantoprazole/">pantoprazole pills stray</a> prevacid astonish
Afyffx
generic rabeprazole 10mg - <a href="https://gastrointesl.com/domperidone/">buy motilium 10mg pill</a> motilium 10mg over the counter
Vjtofr
bisacodyl 5mg uk - <a href="https://gastroinfop.com/oxybutynin/">ditropan price</a> oral liv52 10mg
Hpzrjj
buy cotrimoxazole 480mg online cheap - <a href="https://tobmycin.com/">tobramycin 10mg drug</a> tobra medication
Vcfiox
eukroma cream - <a href="https://danaterone.shop/">purchase eukroma for sale</a> purchase duphaston
Dpumpb
buy dapagliflozin generic - <a href="https://forpaglif.com/">buy dapagliflozin pills</a> brand acarbose
Yrtzde
buy generic griseofulvin - <a href="https://dipyrilx.com/">where to buy dipyridamole without a prescription</a> gemfibrozil 300 mg uk
Rpgacy
buy dimenhydrinate generic - <a href="https://bisacolax.com/">buy dramamine 50 mg without prescription</a> buy actonel 35 mg
Dunllc
buy enalapril 10mg sale - <a href="https://xalanoprost.com/">order zovirax for sale</a> buy xalatan generic
Odbyuy
etodolac price - <a href="https://cilosetal.com/">cilostazol 100mg oral</a> pletal 100 mg pills
Litdya
piroxicam 20mg generic - <a href="https://rivastilons.com/">buy cheap rivastigmine</a> cost exelon 6mg
Knwjwd
piracetam cheap - <a href="https://nootquin.com/praziquantel/">praziquantel online</a> sinemet sale
Cdpokd
buy hydrea paypal - <a href="https://hydroydrinfo.com/disulfiram/">antabuse pills</a> methocarbamol drug
Fbytmm
divalproex sale - <a href="https://adepamox.com/">divalproex for sale online</a> buy topamax tablets
Ghxiei
cheap disopyramide phosphate generic - <a href="https://anorpica.com/">order disopyramide phosphate</a> chlorpromazine 50 mg canada
Arnbzb
cyclophosphamide for sale online - <a href="https://cycloxalp.com/">purchase cytoxan</a> vastarel sale
Fwgyce
order aldactone generic - <a href="https://aldantinep.com/">order aldactone 100mg for sale</a> brand naltrexone 50mg
Ptrliu
buy cyclobenzaprine 15mg without prescription - <a href="https://abflequine.com/">cheap flexeril</a> vasotec pills
Elnkaf
cost zofran 8mg - <a href="https://azofarininfo.com/">zofran 8mg ca</a> order requip 2mg generic
Uqedkc
ascorbic acid 500 mg for sale - <a href="https://mdacidinfo.com/ferroussulfate/">buy ferrous pills for sale</a> buy generic prochlorperazine online
Fcldcl
how to order durex gel - <a href="https://xalaplinfo.com/latanoprosteyedrops/">latanoprost eye drops</a> cheap zovirax
Lgojwy
order rogaine for sale - <a href="https://hairlossmedinfo.com/finasteridepros/">where to buy proscar without a prescription</a> propecia ca
Moynqa
buy arava 10mg sale - <a href="https://infohealthybones.com/alfacalcidol/">buy alfacalcidol sale</a> buy generic cartidin
Drmaao
tenormin 50mg generic - <a href="https://heartmedinfox.com/sotalol/">purchase betapace generic</a> carvedilol 6.25mg price
Fnfgzt
buy verapamil 120mg for sale - <a href="https://infoheartdisea.com/atenolol/">buy tenoretic paypal</a> purchase tenoretic sale
Sgnkqe
cheap atorlip pills - <a href="https://infoxheartmed.com/enalapril/">buy enalapril pills</a> bystolic 20mg brand
Pkulmh
generic gasex - <a href="https://herbalinfomez.com/diabecon/">buy diabecon without a prescription</a> cheap diabecon pills
Pdnzgk
lasuna pills - <a href="https://infoherbalmz.com/">buy lasuna</a> himcolin buy online
Rmavzj
cheap generic noroxin - <a href="https://gmenshth.com/confido/">cheap confido pills</a> where can i buy confido
Xntiap
cheap finax sale - <a href="https://finmenura.com/doxazosin/">cardura pill</a> order uroxatral 10mg pill
Dpdyvu
order speman pills - <a href="https://spmensht.com/finasteride/">order fincar without prescription</a> fincar medication
Ygdakk
hytrin over the counter - <a href="https://hymenmax.com/dutasteride/">buy avodart sale</a> dapoxetine 90mg sale
Mtwhfe
oxcarbazepine order - <a href="https://trileoxine.com/levothyroxine/">buy synthroid generic</a> order levoxyl sale
Pthvwu
cyclosporine over the counter - <a href="https://asimusxate.com/gloperba/">order colcrys pill</a> purchase colchicine without prescription
Qeoruw
buy generic duphalac over the counter - <a href="https://duphalinfo.com/mentat/">cheap mentat without prescription</a> cost betahistine 16mg
Khbbjv
buy deflazacort generic - <a href="https://lazacort.com/">calcort over the counter</a> alphagan generic
Digakc
buy besivance eye drops - <a href="https://besifxcist.com/sildamax/">order sildamax without prescription</a> purchase sildamax for sale
Kafoml
gabapentin over the counter - <a href="https://aneutrin.com/sulfasalazine/">buy generic azulfidine</a> order sulfasalazine 500mg pills
Qmtfyw
benemid 500 mg generic - <a href="https://bendoltol.com/monograph/">order etodolac 600mg without prescription</a> carbamazepine medication
Bflzvi
celecoxib 200mg cost - <a href="https://celespas.com/">cheap celecoxib 200mg</a> indocin 50mg cheap
Sxfkqp
brand colospa 135mg - <a href="https://coloxia.com/pletal/">cilostazol price</a> order pletal without prescription
Bomlfy
diclofenac 50mg ca - <a href="https://dicloltarin.com/aspirin/">order aspirin 75 mg pills</a> purchase aspirin online
Tbxcyw
buy generic rumalaya online - <a href="https://rumaxtol.com/amitriptyline/">buy endep 10mg generic</a> buy endep 50mg online cheap
Bpdyew
cost mestinon - <a href="https://mestonsx.com/azathioprine/">buy generic azathioprine for sale</a> imuran 50mg cheap
Ktkgmd
ozobax buy online - <a href="https://baclion.com/">baclofen pills</a> feldene buy online
Wxlvnt
diclofenac brand - <a href="https://vovetosa.com/">diclofenac drug</a> nimotop online buy
Jzavlv
buy cyproheptadine for sale - <a href="https://periheptadn.com/aszanaflex/">order tizanidine 2mg</a> purchase tizanidine for sale
Xkjzgf
buy meloxicam without prescription - <a href="https://meloxiptan.com/rtrizatriptan/">buy toradol</a> ketorolac price
Nxtxso
buy cefdinir 300mg without prescription - <a href="https://omnixcin.com/">omnicef 300 mg tablet</a> clindamycin oral
Scpkor
cheap trihexyphenidyl pills - <a href="https://voltapll.com.com/">buy artane sale</a> buy voltaren gel online
Scwmll
buy isotretinoin generic - <a href="https://aisotane.com/">isotretinoin 20mg pill</a> order deltasone 10mg sale
Grrifg
purchase deltasone for sale - <a href="https://apreplson.com/prednisolone/">prednisolone 5mg cheap</a> permethrin online order
Hpxrzl
order permethrin for sale - <a href="https://actizacs.com/">acticin online order</a> buy tretinoin without a prescription
Nlnjmq
betamethasone 20 gm usa - <a href="https://betnoson.com/benoquincre/">purchase monobenzone without prescription</a> monobenzone cost
Orjoct
metronidazole 400mg without prescription - <a href="https://cenforcevs.com/">order generic cenforce 100mg</a> buy cenforce 50mg sale
Ckqgrb
how to buy clavulanate - <a href="https://alevonted.com/">levothyroxine us</a> cheap synthroid tablets
Zwjzwe
hyzaar us - <a href="https://cozartan.com/">cozaar 25mg usa</a> keflex us
Xfcgel
cleocin 150mg pills - <a href="https://indometnp.com/">indocin order online</a> where to buy indomethacin without a prescription
Cehpvs
order crotamiton sale - <a href="https://aeuracream.com/abactroban/">buy bactroban ointment without a prescription</a> aczone pills
Xuakoc
order modafinil 200mg without prescription - <a href="https://sleepagil.com/">provigil 200mg ca</a> buy meloset 3 mg online
Onreic
bupropion ca - <a href="https://bupropsl.com/ayurslim/">ayurslim price</a> shuddha guggulu for sale
Admnec
order capecitabine 500mg generic - <a href="https://xelocap.com/naproxen/">naprosyn 250mg brand</a> order danazol 100mg
Qakadz
buy prometrium 200mg - <a href="https://apromid.com/clomiphene/">serophene buy online</a> purchase fertomid sale
Rufbrq
alendronate 70mg cheap - <a href="https://pilaxmax.com/">fosamax 70mg for sale</a> buy provera 5mg for sale
Vqeguc
order aygestin 5 mg online cheap - <a href="https://norethgep.com/lumigan/">cost lumigan</a> buy generic yasmin online
Gzrjzu
buy yasmin without a prescription - <a href="https://festrolp.com/ginette-35/">ginette 35 oral</a> order arimidex 1mg generic
Zxcsck
buy cabergoline generic - <a href="https://adostilin.com/alesse/">alesse online buy</a> buy alesse paypal
Jglubp
гѓ—гѓ¬гѓ‰гѓ‹гѓі еЂ‹дєєијёе…Ґ гЃЉгЃ™гЃ™г‚Ѓ - <a href="https://jpaonlinep.com/jamoxicillin/">г‚ўгѓўг‚­г‚·г‚·гѓЄгѓійЂљиІ©</a> г‚ёг‚№гѓ­гѓћгѓѓг‚Ї гЃ®иіје…Ґ
Jjqcgy
バイアグラ 個人輸入 おすすめ - <a href="https://jpedpharm.com/">シルデナフィル おすすめ</a> シアリス 個人輸入 おすすめ
Exbjbn
プレドニンジェネリック 通販 - <a href="https://jpanfarap.com/">プレドニン 個人輸入 おすすめ</a> 正規品イソトレチノイン錠の正しい処方
Ltogam
eriacta kindle - <a href="https://eriagra.com/asildigrah/">sildigra order</a> forzest unfortunate