摘要:欢迎进入全栈之路之版本控制基础课程博客地址本系列文章将主要针对代码的版本控制进行讲解,希望对广大同行带来一些帮助。下面将重点介绍实际项目中如何提交代码至远程仓库。
欢迎进入全栈之路之版本控制基础课程
博客地址:https://blog.csdn.net/houjiyu...
本系列文章将主要针对代码的版本控制进行讲解,希望对广大同行带来一些帮助。若有问题请及时留言或加QQ:243042162。
寄语:背景
如果你不去希望,你就不会发现什么东西超出了你的希望。
项目建立初期都是先搭建基础框架,再把代码放到代码管理服务器上,让项目组成员进行检出从而进行需求的开发。下面将重点介绍实际项目中如何提交代码至git远程仓库。
步骤
1.下载安装git
自己本身系统是win10,下载地址:https://git-for-windows.githu...
2.初始化版本库:git init
rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center $ git init Initialized empty Git repository in C:/WebstormProjects/cmpy-project/p roject-center/.git/
3.添加文件到版本库:git add .
rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project- center (master) $ git add . warning: LF will be replaced by CRLF in assets/css/font-awesome.min.css. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in assets/js/ie/html5shiv.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in assets/js/ie/respond.min.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in assets/js/jquery.min.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in assets/js/skel.min.js. The file will have its original line endings in your working directory.
4.提交到版本库,并填写提交备注:git commit -m "v1.0"
rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master) $ git commit -m "v1.0" [master (root-commit) 260e147] v1.0 53 files changed, 8306 insertions(+)
5.把本地库与远程库关联:git remote add origin 你的远程库地址
rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master) $ git remote add origin 远程库地址
6.推送至远程:git push -u origin master -f
rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master) $ git push -u origin master -f Counting objects: 65, done. Delta compression using up to 4 threads. Compressing objects: 100% (65/65), done. Writing objects: 100% (65/65), 478.97 KiB | 0 bytes/s, done. Total 65 (delta 2), reused 0 (delta 0)
7.查看状态:git status
rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master) $ git status On branch master Your branch is up-to-date with "origin/master". nothing to commit, working tree clean
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/75249.html
摘要:简介是目前世界上最先进的分布式版本控制系统没有之一。查看所有分支的版本操作记录。工作区直接删除文件,提交到版本库。与他人协作涉及管理远程仓库以及根据需要推送或拉取数据。克隆远程仓库支持多种协议,默认使用,也可以使用等其他协议。 Git简介 Git是目前世界上最先进的分布式版本控制系统(没有之一)。Linux之父Linux用C语言写了Git分布式版本控制系统。 分布式版本控制系统与集中式...
阅读 2354·2021-10-14 09:42
阅读 1117·2021-09-22 15:09
阅读 3501·2021-09-09 09:33
阅读 2971·2021-09-07 09:59
阅读 3617·2021-09-03 10:34
阅读 3506·2021-07-26 22:01
阅读 2799·2019-08-30 13:06
阅读 1149·2019-08-30 10:48