referredgit

git 使用  时间:2021-02-24  阅读:()
GitandGithubKatieOsterriedC2SMCOSMOGeneralMeeting2016Outline1Introductiontogit2Basicgitfeatures3Workingwithremotes4Githubwebinterface5UsefulgitresourcesOutline1Introductiontogit2Basicgitfeatures3Workingwithremotes4Githubwebinterface5UsefulgitresourcesWhatisgitVersioncontrolsystem(likeSVN)Toolfortrackingofchangesinlesinorderto:RecordreasonsforchangesComparewithandincorporateversionsfromothersourcesHavemultiplepeopledevelopingthesamecodeMaintainseveralparallelversionsofthesamecodeinasystematicwayDesignedforcollaborative,opensourceworkowsSource:https://git-scm.
com/downloads/logosStatusoftheC2SMgitmigrationC2SMhostedCOSMOandrelatedcodesweresuccessfullymigratedfromSVNtogitinDecember2015AllthecodedevelopmenthistorywasretainedduringthemigrationCodeisnowhostedongithub.
comin42separatecoderepositoriesFieldextraandExtparocialversionsnowhostedonGithubGitTerminology1.
repository:thelocationofthesavedcodeanditshistory2.
branch:anindependentlineofdevelopment3.
master:thedefaultbranch4.
commit:asnapshotofyourprojectatacertaintime5.
tag:afrozenreferencetoaparticularcommit6.
HEAD:thecurrentlycheckedoutcommit7.
index/stagingarea:areabetweenworkingdirectoryandrepository8.
remote:arepositorylinkedtothelocalrepositoryImportantdierencesfromSVNGitisadistributedversioncontrolsystemEveryuserhasthewholerepositoryUserscansavechangestothelocalrepositorywithoutanetworkRepositoriescanbelocatedanywhereandlinkedtogethereasilyWorkowforagroupmustbeclearlydenedSource:http://www.
codemag.
com/Article/1105101ImportantdierencesfromSVNGitusesastrictdenitionofbranchesandtagsBranchesandtagsarenotassociatedwithdierentdirectories(likeSVN)BranchesandtagsaresimplypointerstoacertaincommitThetrunkequivalentiscalled"master"andisnodierentfromanyotherbranchImportantdierencesfromSVNGitusesdierentcommitIDsLinearrevisionnumbersdon'tworkEachcommithasauniqueidentiergeneratedbyanalgorithmSeriesof40charactersandnumbersCommitscanbegenerallyreferredtobytherst6-8charactersoftheIDExample:commitf3abe64fc121b75f3f0566c73f2f1a4e8fd68eCanbereferredtoas:f3abe64ImportantdierencesfromSVNGitusesastagingareaAdditionallayerbetweenworkingdirectoryandrepositoryStoresinformationaboutwhatwillgointhenextcommitAllowsyoutogroupcommitslogicallySource:https://git-scm.
com/book/en/v1/Getting-Started-Git-BasicsOutline1Introductiontogit2Basicgitfeatures3Workingwithremotes4Githubwebinterface5UsefulgitresourcesLocalgitworkow1.
Startorcopyagitrepositorylocally(gitinit,gitclone)2.
Makeafeaturebranchfordeveloping(gitbranch,gitcheckout)3.
Makesomecodechanges4.
Savethecodechangestothestagingarea(gitadd)5.
Savethecodechangestotherepository(gitcommit)6.
Mergethechangesfromthefeaturebranchtothemaster(gitmerge)HowtostartarepositoryCommandstostartworkingwithgit:gitcongSetcongurationvariablesforgitUsage:gitconguser.
name"YourName"Usage:gitcong--globaluser.
email"youremail@email.
com"gitinitCreatesanemptygitrepositoryCreatesbydefaultthemasterbranchCreatesthe.
gitfolderandcontentsUsage:gitinitgitcloneCopiesanexistinggitrepositoryCreatesandnavigatestothecurrentbranchofthecopiedrepositoryLinkstheoriginalrepositoryasaremoteUsage:gitclone/path_to_original/path_to_copyHowtomakecommitsCommandsforsavingcodechanges:gitaddSavescodechangestothestagingareaCanaddallorsomeofthecurrentcodechangesCanbeperformedmultipletimesbeforeacommitUsage:gitadd/path_to_legitcommitSavesthechangesinthestagingareatotherepositoryCreatesauniquecommitIDSavesalogmessagefromtheuserUsage:gitcommitHowtoexaminearepositoryCommandsforgettinginformationaboutarepository:gitlogDisplaysthelogofallthecommitsCanbecustomizedthroughcommandlineoptionsUsage:gitloggitstatusShowsthestatusoftheworkingcopyStateswhichleshavebeenplacedinthestagingareaShowswhichleshavebeenmodiedbutnotplacedinthestagingareaUsage:gitstatusgitdiShowsthechangesbetweentwoversionsofthecodeManyoptionsforcustomizationUsage:gitdiHowtoexaminearepositoryCommandsforlookingatpreviouscommits:gitcheckout(oldcommit)DisplaystheworkingcopyasitwaswhenthecommitwasmadeShouldbeusedforlookingatoldcommits,notdevelopmentAnythingcommittedwillNOTbesavedtoacurrentbranchUsage:gitcheckoutcommitIDgitcheckout(singlele)UpdatestheleinthecurrentworkingcopyUsedforrecoveringoldversionsoflesAnythingcommittedWILLbesavedtothecurrentbranchUsage:gitcheckoutcommitID/path_to_leHowtocreateandswitchtoabranchCommandsforworkingwithbranches:gitbranchListscurrentbranchesorcreatesanewoneCreatesbranchfromcurrentHEADDoesnotautomaticallyswitchtonewbranchUsage:gitbranchbranch_namegitcheckout(branch)ChangesthelesintheworkingcopytothebranchLocalchangesarepreservedUsage:gitcheckoutbranch_nameMergingwithoutcommitsFast-forwardmergeisthedefaultbehaviorgitmergeCombinesthetargetbranchwiththecurrentbranchDoesnotcreateacommitunlessithasto(oryoutellitto)CalledfromthebranchyouwanttomergeintoUsage:gitmergebranch_nameMergingwithoutcommitsFast-forwardmergeisthedefaultbehaviorgitmergeCombinesthetargetbranchwiththecurrentbranchDoesnotcreateacommitunlessithasto(oryoutellitto)CalledfromthebranchyouwanttomergeintoUsage:gitmergebranch_nameMergingwithoutcommitsFast-forwardmergeisthedefaultbehaviorgitmergeCombinesthetargetbranchwiththecurrentbranchDoesnotcreateacommitunlessithasto(oryoutellitto)CalledfromthebranchyouwanttomergeintoUsage:gitmergebranch_nameMergingwithcommitsConictingmergesalsooccurgitmergeAcommitismadeforaconictingmergeConictsmustberesolvedbeforemergeiscompletedRemoveconictmarkersfromconictedlesgitaddconictedlegitcommitconictedleUsage:gitmergebranch_nameOutline1Introductiontogit2Basicgitfeatures3Workingwithremotes4Githubwebinterface5UsefulgitresourcesgitusesremotesEachlocalrepositorycanconnecttomultipleremoterepositoriesRemotescanbelocaloracrossanetworkRemotescanberead-onlyorread-writeaccessWorkowmustbeclearlydenedfromthebeginningSource:http://thepilcrow.
net/explaining-basic-concepts-git-and-githubHowtolinktoaremoteCommandsforconnectingtoandexaminingremotes:gitremoteListsalloftheremoterepositoriesUsing-voptionlistsalltheremoterepositoriesandtheirpathsUsage:gitremote(-v)gitremoteaddConnectsanexistingrepositorywitharemoteoneUsage:gitremoteaddremote_name/path_to_remotegitremoteshowDisplaysdetailedinformationabouttheselectedremoteListsbranchesinremoterepositoryandhowtheyarelinkedtothelocalrepositoryUsage:gitremoteshowremote_nameHowtogetcodefromaremoteCommandsforexchangingcodewithremotes:gitfetchUpdatesdatainremotebranchesoflocalrepositoryCantheninspectand/ormergethisdataintolocalbranchesUsage:gitfetchremote_namegitpullUpdatesdatainremotebranchesoflocalrepositoryAutomaticallymergesremotedataintolocalbranchesgitpull=gitfetch+gitmergeUsage:gitpullremote_namegitpushSendschangesintoremoterepositoryMustdoagitfetchandgitmergerst,tomakesurethatthelocalbranchisuptodatewiththeremoteUsage:gitpushremote_namebranch_nameRemotebranchesGitusesremotebranchestotrackchangestoremoterepositoriesBranchesinthelocalrepositorycontainingdatafromremotesCanbedisplayedusinggitbranch-aCreatedduringgitcloneautomaticallyTaketheformremote_name/branch_nameSource:https://git-scm.
com/book/en/v2/Git-Branching-Remote-BranchesDemonstrationOutline1Introductiontogit2Basicgitfeatures3Workingwithremotes4Githubwebinterface5UsefulgitresourcesGithubWebinterfaceforhostingremotesWebserviceshostremoterepositories(canbepublicorprivate)ProvideinterfacesforvisualizingrepositoriesSupportcollaborationandgoodcodingpracticesCanalsoeditlesandmakecommitsthereSource:https://github.
com/logosPermissionsTherearethreedierentlevelsofpermissionsforaccessingthecoderepositoriesonGithub:1.
OwnersTwoorthreepeopleonlyHavecompletecontroloverthecoderepositoriesCancreateordeleterepositories,addusers,andwritetoeveryrepository2.
AdminsOneortwopeopleforeachrepository(admin-codename)HavewriteandreadaccesstotheirassignedrepositoryAddnewversionsofcodeandincorporatenewfeaturesandbugxes3.
UsersEveryonewhoisnotanowneroradminHavereadaccesstoallofthecentralrepositoriesPullRequestsPullrequestsareusedtoreviewcodebeforemergingnewfeaturesintothemaincodebaseRequestforchangesfromafeaturebranchtobeputintocentralrepositoryGeneratedthroughwebinterface(notcommandline)CanbemergedusingwebinterfaceifnomergeconictsexistWebinterfacefacilitatesreviewofandcommentingoncodebeforepullrequestisgrantedSource:https://www.
atlassian.
com/zh/git/workows#!
pull-requestIssuetrackingWeusetheissuetrackeronGithubasanorganizationaltoolIssuetrackersallowyoutokeeptrackofknownbugs,desiredfeatures,andotherto-doitemsforthecodeIssuescanbeassignedtoaspecicpersonOtheruserscansubscribetobenotiedwhenknownissuesareresolvedIssuescanbecolor-codedandlabeledsotheyareeasilylteredAnybodywithaccesstotherepositorycancommentonissuesCosmo-prereleaserepositoryworkow1.
Copytherepositorytoyourlocalmachine(gitclone)2.
Makeafeaturebranchforyourowndevelopment(gitbranch)3.
MakechangestoyourlocalrepositoryfollowingthelocalGitworkow4.
Savethechangestothecosmo-prereleaserepository(gitpush)5.
Makeapullrequesttostartthecodereviewprocess(Generatepullrequestusingwebinterface)6.
TestthebranchusingtheautomatedtestingprogramJenkins('launchjenkins'commandinpullrequestcomments)7.
Oncetestshavepassedandcodehasbeenreviewed,thecodeownerwillmergethepullrequest(Mergepullrequestusingwebinterface)DemonstrationOutline1Introductiontogit2Basicgitfeatures3Workingwithremotes4Githubwebinterface5UsefulgitresourcesBestPracticesSomebestpracticeswhenworkingwithGit:ChooseaworkowatthebeginningofaprojectandstickwithitWherewilldevelopmentofnewfeaturesoccur(branches,forks)WhatisthenamingconventionforbranchesandforksWhoisresponsibleforthecentralrepositoryHowwillthecodereview/pullrequestprocessworkReviewcodeinstagingareabeforecommittingitCommitsmalllogicalchangesMakeusefulcommitmessagesthatcanbeunderstoodbyanyoneFirstlineofmessageshouldbeaonelinesummaryDetailsofcommitfollowthesummaryKeeprepositoryclean-removeunused/nishedbranchesGitResourcesgithelpDisplaysthemanpageforthegivencommandDisplaysgeneralgitinformationwhennocommandnameisgivenUsage:githelp(command_name)http://git-scm.
com/ComprehensivedescriptionofGitcommandsandconceptshttp://gitref.
org/Quickreferenceguideforcommandshttps://training.
github.
com/kit/downloads/github-git-cheat-sheet.
pdfCheatsheetwithGitcommandsGraphicalgittoolsBuilt-ingitgraphicaltoolsgitkDisplayschangesinarepository;informationaboutcommitsCannotbeusedtomakecommitsgit-guiUsedformakingchangestoarepositoryCancommit,branch,merge,andinteractwithremotesDoesnotshowcodehistoryThirdpartygitgraphicaltoolsSourceTreeCancommit,branch,merge,andinteractwithremotesCanviewhistoryandcommitsOnlyforOS:MacandWindowsSmartGitCancommit,branch,merge,andinteractwithremotesCanviewhistoryandcommitsOS:Mac,Linux,andWindowshttp://www.
syntevo.
com/smartgit/

麻花云:3折优惠,香港CN2安徽麻花云香港安徽移动BGP云服务器(大带宽)

麻花云在7月特意为主机测评用户群定制了促销活动:香港宽频CN2云服务器、安徽移动云服务器(BGP网络,非单线,效果更好)、安徽移动独立服务器、安徽电信独立服务器,全部不限制流量,自带一个IPv4,默认5Gbps的DDoS防御。活动链接:https://www.mhyun.net/act/zjcp特价云服务器不限流量,自带一个IPv4,5Gbps防御香港宽频CN2全固态Ⅲ型 4核4G【KVM】内存:...

数脉科技:香港服务器低至350元/月;阿里云CN2+BGP线路,带宽10M30M50M100M

数脉科技(shuhost)8月促销:香港独立服务器,自营BGP、CN2+BGP、阿里云线路,新客立减400港币/月,老用户按照优惠码减免!香港服务器带宽可选10Mbps、30Mbps、50Mbps、100Mbps带宽,支持中文本Windows、Linux等系统。数脉香港特价阿里云10MbpsCN2,e3-1230v2,16G内存,1T HDD 或 240G SSD,10Mbps带宽,IPv41个,...

HostWebis:美国/法国便宜服务器,100Mbps不限流量,高配置大硬盘,$44/月起

hostwebis怎么样?hostwebis昨天在webhosting发布了几款美国高配置大硬盘机器,但报价需要联系客服。看了下该商家的其它产品,发现几款美国服务器、法国服务器还比较实惠,100Mbps不限流量,高配置大硬盘,$44/月起,有兴趣的可以关注一下。HostWebis是一家国外主机品牌,官网宣称1998年就成立了,根据目标市场的不同,以不同品牌名称提供网络托管服务。2003年,通过与W...

git 使用为你推荐
discuznt最近搞了个论坛用的是discuz nt 的程序 网站地址是:www.wuxiankj.net 但有时经常会出现 HTTP Error 503.人人时光机寻时光机歌词吴晓波频道买粉罗辑思维,晓松奇谈,鸿观,吴晓波频道,财经郎眼哪个更有深度二叉树遍历写出二叉树的先序遍历、中序遍历、后序遍历。显卡温度多少正常显卡温度多少算正常?迅雷云点播账号求个迅雷VIP 是VIP就可以 只用来看云点播 改密码是孙子。 谢了 ! 362135668@qq.comios系统ios是什么意思 ios系统是什么网页打开很慢为什么打开网页很慢qq等级表QQ等级列表怎样申请支付宝怎么申请支付宝
天津虚拟主机 免费ftp站点 40g硬盘 qq对话框 支持外链的相册 空间首页登陆 magento主机 byebyelove 最好的空间日志 个人web服务器 天玑创梦独角兽1期 免费mysql空间 英国伦敦塔桥 盛大免费网络游戏 国际认证机构 在线木马检测 letmeloveyou dontletmego letmehitit letmeletyougo 更多