丰富的线上&线下活动,深入探索云世界
做任务,得社区积分和周边
最真实的开发者用云体验
让每位学生受益于普惠算力
让创作激发创新
资深技术专家手把手带教
遇见技术追梦人
技术交流,直击现场
海量开发者使用工具、手册,免费下载
极速、全面、稳定、安全的开源镜像
开发手册、白皮书、案例集等实战精华
为开发者定制的Chrome浏览器插件
versioncontrol:controlversion
VersionCotrolSystems:Git,Subversion,Mercurial
git:Distributedversioncontrolsystem
versioncontrolsystem(VCS)isatoolthatmanagesdifferentversionsofsourcecode.
sourcecodemanager(SCM)isanothernameforaversioncontrolsystem.
commitsavethestateofyourprojectinGit
repository(repo)isadirectorywhichcontainsyourprojectwork,aswellasafewfileswhichareusedtocommunicatewithGit.Repositoriescanexiteitherlocallyonyourcomputerorasremotecopyonanothercomputer.Arepositoryismadeupofcommits.
workingdirectoryisthefilesthatyouseeinyourcomputer'sfilesystem.Whenyouopenyourprojectfilesuponacodeeditor,you'reworkingwithfilesintheWorkingDirectory.Thisisincontrasttothefilesthathavebeensaved(incommits!)intherepository.WhenworkingwithGit,theWorkingDirectoryisalsodifferentfromthecommandline'sconceptofthecurrentworkingdirectorywhichisthedirectorythatyourshellis"lookingat"rightnow.
CheckoutiswhencontentintherepositoryhasbeencopiedtotheWorkingDirectory.
StagingArea/StagingIndex/IndexAfileintheGitdirectorythatstoresinformationaboutwhatwillgointoyournextcommit.
SHAisbasicallyanIDnumberforeachcommit.Itisa40-characterstringcomposedofcharacters(0-9anda-f)andcalculatedbasedonthecontentsofafileordirectorystructureinGit.SecureHashAlgorithm.
Branchiswhenanewlineofdevelopmentiscreatedthatdivergesfromthemainlineofdevelopment.
gitusage:git[--version][--help][-C][-cname=value][--exec-path[=]][--html-path][--man-path][--info-path][-pl--paginate|--no-pager][--no-replace-objects][--bare][--git-dir=][--work-tree=][--namespace=][]
Themostcommonlyusedgitcommandsare:
'githelp-a'and'githelp-g'listsavailablesubcommandsandsomeconceptguides.See'githelp'or'githelp'toreadaboutaspecificsubcommandorconcept.
ConfigurationSteps
cdstart.mvudacity-terminal-config.udacity-terminal-configFirstTimeGitConfiguration
gitconfig--globaluser.name"
AtomEditorSetup
gitconfig--globalcore.editor"atom--wait"SublimeTextSetup
gitconfig--globalcore.editor"'/Applications/SublimeText2.app/Contents/SharedSupport/bin/subl'-n-w"