当前位置:网站首页>我是如何使用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
边栏推荐
- 如何更好地理解中间件和洋葱模型
- Use Python to guess which numbers in the set are added to get the sum of a number
- LeetCode:二叉树(四)
- I have a crossed translation tool in my hand!
- 奸商加价销售mate40,小米可望在高端手机市场夺取更多市场
- Swoole 如何使用 Xdebug 进行单步调试
- New feature of ios14 -- development and practice of widgetkit
- Version 4.5.7 of swoole was released, and the -- enable swote JSON compilation option was added
- Taulia launches international payment terms database
- 上线1周,B.Protocal已有7000ETH资产!
猜你喜欢

Want to spend money to learn the Internet industry quickly, about two or three months, come out to find a job

Looking for a small immutable dictionary with better performance

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

The use of Python PIP command

Do not understand the code, can type can build a station? 1111 yuan gift bag to help you with one stop!

Farfetch、阿里巴巴集团和历峰集团结成全球合作伙伴关系,将加速奢侈品行业数字化进程

Magicodes.IE 3.0 talk about heavy design

SEO industry, what are the 10 pieces of good advice worth collecting?

Leetcode: binary tree (4)

Sign in with apple
随机推荐
Farfetch、阿里巴巴集团和历峰集团结成全球合作伙伴关系,将加速奢侈品行业数字化进程
A professional tour -- a quick tour of GitHub hot spots Vol.45
Multibank group announced record financial results with gross profit of $94 million in the first three quarters of 2020
express -- 学习笔记(慕课)
Do not understand the code, can type can build a station? 1111 yuan gift bag to help you with one stop!
【操作教程 】国标GB28181协议安防视频平台EasyGBS订阅功能介绍及开启步骤
Summary of basic concepts and common operations of elasticsearch cluster (recommended Collection)
如何更好地理解中间件和洋葱模型
Common skills of JS array
一不小心画了 24 张图剖析计网应用层协议!
[technical course] peerconnection in webrtc self built by visual studio 2017_ The client program reported an external symbol error that LNK2019 could not resolve
Swoole v4.5.7 版本发布,新增--enable-swoole-json编译选项
[operation tutorial] introduction and opening steps of easygbs subscription function of national standard gb28181 protocol security video platform
Centos7 local source Yum configuration
Swoole 如何使用 Xdebug 进行单步调试
CCR coin robot: novel coronavirus pneumonia has accelerated the interest of regulators in CBDC.
【技术教程】Visual Studio 2017自建WebRTC中peerconnection_client程序报LNK2019 无法解析的外部符号错误
8、参数校验
Leetcode: binary tree (4)
LeetCode 5561. 获取生成数组中的最大值