当前位置:网站首页>我是如何使用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
边栏推荐
猜你喜欢
寻找性能更优秀的不可变小字典
Design mode (8) -- command mode
python math类
Python math class
A professional tour -- a quick tour of GitHub hot spots Vol.45
Sign in with apple
Farfetch、阿里巴巴集团和历峰集团结成全球合作伙伴关系,将加速奢侈品行业数字化进程
Understanding of learning to estimate 3D hand pose from single RGB images
Come on! Hungry? Software testing Python automation post core interview questions out, how many will you come down the whole process?
一不小心画了 24 张图剖析计网应用层协议!
随机推荐
nodejs 个人学习笔记(imook)pm2
世界上最伟大的10个公式,其中一个人尽皆知
How does hystrix solve ThreadLocal information loss
从大专生到蚂蚁金服CTO,他写下“支付宝”第一行代码:逆风的方向,更适合飞翔!...
Design mode (8) -- command mode
Centos7 rsync+crontab 定时备份
Why should small and medium sized enterprises use CRM system
为什么要谨慎使用Arrays.asList、ArrayList的subList?
用例子理解递归
低至 2 折的云数据库,你见过?
Book City Project: phase 1
learning to Estimate 3D Hand Pose from Single RGB Images论文理解
Understanding recursion with examples
Common skills of JS array
我手撸了一个划线翻译工具!
Leetcode: binary tree (4)
One of the 10 Greatest formulas in the world is well known
监控系统选型,这篇不可不读!
Double eleven second kill system. Have you ever snatched it?
python pip命令的使用