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/

随风云25元/月 ,德阳高防云服务器 2核2G 10M 75元/月 内蒙古三线BGP服务器 2核2G 5M

公司介绍成都随风云科技有限公司成立于2021年,是国内领先的互联网业务平台服务提供商。公司专注为用户提供低价高性能云计算产品,致力于云计算应用的易用性开发,并引导云计算在国内普及。目前公司研发以及运营云服务基础设施服务平台(IaaS),面向全球客户提供基于云计算的IT解决方案与客户服务,拥有丰富的国内BGP、双线高防、香港等优质的IDC资源。公司一直秉承”以人为本、客户为尊、永续创新&...

丽萨主机:美国CN2 GIA精品网/KVM/9折,美国原生IP,最低27元/月

丽萨主机怎么样?丽萨主机,团队于2017年成立。成立之初主要做的是 CDN 和域名等相关业务。最近开辟新领域,新增了独立服务器出租、VPS 等业务,为了保证业务质量从一开始就选择了中美之间的 CN2 GIA 国际精品网络,三网回程 CN2 GIA,电信去程 CN2 GIA + BGP 直连智能路由,联通移动去程直连,原生IP。适合对网络要求较高的用户,同时价格也比较亲民。点击进入:丽萨主机官方网站...

hypervmart:英国/荷兰vps,2核/3GB内存/25GB NVMe空间/不限流量/1Gbps端口/Hyper-V,$10.97/季

hypervmart怎么样?hypervmart是一家国外主机商,成立于2011年,提供虚拟主机、VPS等,vps基于Hyper-V 2012 R2,宣称不超售,支持linux和windows,有荷兰和英国2个数据中心,特色是1Gbps带宽、不限流量。现在配置提高,价格不变,性价比提高了很多。(数据中心不太清楚,按以前的记录,应该是欧洲),支持Paypal付款。点击进入:hypervmart官方网...

git 使用为你推荐
找不到光驱找不到光驱,光盘,怎么办依赖注入请问下依赖注入的三种方式的区别二叉树遍历写出二叉树的先序遍历、中序遍历、后序遍历。百度手写百度输入法切换手写 百度汉王手写输入法显卡温度多少正常显卡温度多少算正常申请证书申请毕业证书办公协同软件最好用的协同办公软件是哪个苹果5怎么越狱苹果5怎么越狱iphone越狱后怎么恢复苹果手机越狱之后能恢复原来吗?直播加速怎么让已拍摄好的视频加速
下载虚拟主机 花生壳域名 网络域名 个人域名注册 国外vps 购买域名和空间 wordpress主机 qq云存储 eq2 促正网秒杀 海外空间 河南移动梦网 免费asp空间申请 97rb asp空间 闪讯网 nnt .htaccess 卡巴斯基官方下载 性能测试工具 更多