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/

Puaex:香港vds,wtt套餐,G口带宽不限流量;可解流媒体,限量补货

puaex怎么样?puaex是一家去年成立的国人商家,本站也分享过几次,他家主要销售香港商宽的套餐,给的全部为G口带宽,而且是不限流量的,目前有WTT和HKBN两种线路的方面,虽然商家的价格比较贵,但是每次补一些货,就会被抢空,之前一直都是断货的状态,目前商家进行了补货,有需要这种类型机器的朋友可以入手。点击进入:puaex商家官方网站Puaex香港vds套餐:全部为KVM虚拟架构,G口的带宽,可...

Spinservers:美国圣何塞机房少量补货/双E5/64GB DDR4/2TB SSD/10Gbps端口月流量10TB/$111/月

Chia矿机,Spinservers怎么样?Spinservers好不好,Spinservers大硬盘服务器。Spinservers刚刚在美国圣何塞机房补货120台独立服务器,CPU都是双E5系列,64-512GB DDR4内存,超大SSD或NVMe存储,数量有限,机器都是预部署好的,下单即可上架,无需人工干预,有需要的朋友抓紧下单哦。Spinservers是Majestic Hosting So...

速云:广州移动/深圳移动/广东联通/香港HKT等VDS,9折优惠,最低月付9元;深圳独立服务器1050元/首月起

速云怎么样?速云,国人商家,提供广州移动、深圳移动、广州茂名联通、香港hkt等VDS和独立服务器。现在暑期限时特惠,力度大。广州移动/深圳移动/广东联通/香港HKT等9折优惠,最低月付9元;暑期特惠,带宽、流量翻倍,深港mplc免费试用!点击进入:速云官方网站地址速云优惠码:全场9折优惠码:summer速云优惠活动:活动期间,所有地区所有配置可享受9折优惠,深圳/广州地区流量计费VDS可选择流量翻...

git 使用为你推荐
google地球打不开手机谷歌地球怎么打不开?行业关键词怎么挖掘关键词呢,都有哪些方法网络明星哪个知道这个网络明星叫什么?安装程序配置服务器失败安装用友T3出现安装程序配置服务器失败是怎么回事站长故事科学家的故事200字打开网页出现错误网页上有错误怎么解决?自助建站自助建站到底好还是不好pw美团网电话是什么pw安卓应用平台安卓手机下软件哪个网站好iphone越狱后怎么恢复已经越狱的iphone怎么恢复到原来的系统
域名查询软件 注册cn域名 老左 enzu idc测评网 68.168.16.150 湖南服务器托管 qingyun 刀片服务器是什么 bgp双线 nerds 香港亚马逊 789 工信部网站备案查询 免费蓝钻 创速 xshell5注册码 SmartAXMT800 酷锐 碳云 更多