当前位置:网站首页>我是如何使用git把本地代码上传到github上的,值得借鉴
我是如何使用git把本地代码上传到github上的,值得借鉴
2020-11-10 11:27:00 【osc_47pscir3】
背景:最近开发了一套招标系统,我是如何用JSP在网络上架构一个网上招标系统,以推进网站无纸化,过程电子化,管理智能化的发展。
使用git进行上传。

首先自己得有git工具及github账号,自己没有的提前准备一下。我本地文件夹已经放了数据库及源代码,我直接在那个文件夹进行操作。
进去该文件夹。鼠标右键,打开git -> Git Bash Here -> git init。执行命令后目录下创建一个.git文件夹。
git init

查看状态
git status

git add + 需要添加的文件名 或者git add --all 将所有的文件全部添加,我这里是
git add --all
这个命令会把当前路径下的所有文件,添加到待上传的文件列表中。

将add的文件commit到仓库,添加之后,最后提交就行,git commit -m “修改说明”。-m后面添加的是对本次操作的说明,加入你修改了代码或者重新上传了什么东西都做个简单说明,别人看了就知道是怎么回事了。然后再次git status查看状态,如下,已经添加成功:
git commit -m "提交源代码"

去github上创建自己的Repository,点击Create repository,一步一步执行下去即可,创建成功后拿到创建的仓库的https地址

将本地的仓库关联到github上,我这里使用的是https,大家也可以使用ssh,配置公钥请参考我上一篇文章:gitlab或者gitee生成/添加SSH公钥的解决办法

上传代码到github远程仓库。执行完后,如果没有异常,等待执行完就上传成功了,中间可能会让你输入Username和Password,你只要输入github的账号和密码就行了
git push -u origin master

在github检查一下提交的主分支,ok大功告成,加油打工人

版权声明
本文为[osc_47pscir3]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4259809/blog/4710903
边栏推荐
- Magicodes.IE 3.0 talk about heavy design
- Centos7 local source Yum configuration
- 腾讯云TBase在分布式HTAP领域的探索与实践
- Getiservicemanager () source code analysis
- Harbor项目高手问答及赠书活动火热进行中
- To speed up the process of forming a global partnership between lifech and Alibaba Group
- layer.prompt(options, yes) - 输入层
- .MD语法入门
- C language uses random number to generate matrix to realize fast transposition of triples.
- C语言使用随机数生成矩阵,实现三元组的快速转置。
猜你喜欢

Come on! Hungry? Software testing Python automation post core interview questions out, how many will you come down the whole process?

一个 Task 不够,又来一个 ValueTask ,真的学懵了!

ASP.NET Core框架揭秘[博文汇总

getIServiceManager() 源码分析

MFC interface development help document -- BCG how to place controls on the toolbar

Swoole 如何使用 Xdebug 进行单步调试

【操作教程 】国标GB28181协议安防视频平台EasyGBS订阅功能介绍及开启步骤

Book City Project: phase 1

Harbor项目高手问答及赠书活动火热进行中

带劲!饿了么软件测试python自动化岗位核心面试题出炉,你全程下来会几个?
随机推荐
不用懂代码,会打字就可以建站?1111 元礼包帮你一站配齐!
What should be paid attention to when designing API to get data through post
阿里巴巴开发手册强制使用SLF4J作为门面担当的秘密,我搞清楚了
【技术教程】C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程
子线程调用invalidate()产生“Only the original thread that created a view hierarchy can touch its views.”原因分析
nodejs 个人学习笔记(imook)pm2
行人重识别阅读笔记之Unity Style Transfer for Person Re-Identification
JS basic algorithm (1)
layer.prompt(options, yes) - 输入层
一不小心画了 24 张图剖析计网应用层协议!
The unscrupulous merchants increase the price of mate40, and Xiaomi is expected to capture more market in the high-end mobile phone market
CentOS7本地源yum配置
我手撸了一个划线翻译工具!
Design mode (8) -- command mode
高通骁龙875夺安卓处理器桂冠,但外挂5G基带成为它的弊病
Custom annotation! Absolutely is the sharp weapon that programmer installs force!!
《Python Cookbook 3rd》笔记(2.3):用Shell通配符匹配字符串
Api: tiktok: Video Review List
ASP.NET Core framework revealed
LeetCode:二叉树(四)