git把本地文件上传到github上的步骤

简介: git把本地文件上传到github上的步骤

1.清除clean


2.返回上一级cd ..


3.克隆仓库地址git clone+地址


4.添加忽悠文件vim .gitignore


5查看cat .gitignore


6.进入到test,并且添加所有的文件:cd test    git add.


7.查看状态,绿色git status


8.提交git commit  -am "wangtingwx"


9.查看状态


10.放到github:   ----------git  push origin master


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/weixin


$ clean


bash: clean: command not found


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/weixin


$ clear


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/weixin


$ cd ..


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects


$ git clone https://github.com/wangxiaoting666/test.git


Cloning into 'test'...


warning: You appear to have cloned an empty repository.


Checking connectivity... done.


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects


$ vim .gitignore


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects


$ cat .gitignore


node_modules


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects


$ cd test


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/test(master)


$ git add .


warning: LF will be replaced by CRLF in node_modules/.bin/mime.


The file will have its original line endings in your working directory.


warning: LF will be replaced by CRLF in node_modules/accepts/HISTORY.md.


The file will have its original line endings in your working directory.


warning: LF will be replaced by CRLF in node_modules/accepts/LICENSE.


The file will have its original line endings in your working directory.


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/test(master)


$ git status


On branch master


Initial commit


Changes to be committed:


(use "git rm --cached ..." to unstage)


new file:   .project


new file:   node_modules/.bin/mime


new file:   node_modules/.bin/mime.cmd


new file:   node_modules/accepts/HISTORY.md


new file:   node_modules/accepts/LICENSE


new file:   node_modules/accepts/README.md


new file:   node_modules/accepts/index.js


new file:   node_modules/accepts/package.json


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/test(master)


$ git commit -am "wangtingwx"


[master (root-commit) 93dfc21] wangtingwx


warning: LF will be replaced by CRLF in node_modules/.bin/mime.


The file will have its original line endings in your working directory.


warning: LF will be replaced by CRLF in node_modules/accepts/HISTORY.md.


The file will have its original line endings in your working directory.


warning: LF will be replaced by CRLF in node_modules/accepts/LICENSE.


The file will have its original line endings in your working directory.


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/test(master)


$ git status


On branch master


Your branch is based on 'origin/master', but the upstream is gone.


(use "git branch --unset-upstream" to fixup)


nothing to commit, working directory clean


Administrator@PC-20160607HTQZMINGW64/d/Documents/HBuilderProjects/test(master)


$ git push origin master


Username for 'https://github.com': wangxiaoting666


Counting objects: 314, done.


Delta compression using up to 2 threads.


Compressing objects: 100% (302/302), done.


Writing objects: 100% (314/314), 284.07 KiB | 0 bytes/s, done.


Total 314 (delta 65), reused 0 (delta 0)


remote: Resolving deltas: 100% (65/65), done.


To https://github.com/wangxiaoting666/test.git


* [new branch]      master -> master

相关文章
|
存储 安全 开发工具
Git安装与配置:操作步骤+Gitee绑定
本文系统介绍了Git从安装配置到远程协作的全流程,涵盖基础概念、常用命令、分支管理、冲突解决及Gitee实战操作,助你高效掌握代码版本控制与团队协作技巧。
1808 155
|
存储 NoSQL 开发工具
Git Clone 原理详解:为什么它比本地文件复制更快? -优雅草卓伊凡
Git Clone 原理详解:为什么它比本地文件复制更快? -优雅草卓伊凡
518 26
Git Clone 原理详解:为什么它比本地文件复制更快? -优雅草卓伊凡
|
开发工具 git
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
2355 69
如何操作github,gitee,gitcode三个git平台建立镜像仓库机制,这样便于维护项目只需要维护一个平台仓库地址的即可-优雅草央千澈
|
人工智能 API 开发工具
GitHub官方开源MCP服务!GitHub MCP Server:无缝集成GitHub API,实现Git流程完全自动化
GitHub MCP Server是基于Model Context Protocol的服务器工具,提供与GitHub API的无缝集成,支持自动化处理问题、Pull Request和仓库管理等功能。
4065 2
GitHub官方开源MCP服务!GitHub MCP Server:无缝集成GitHub API,实现Git流程完全自动化
|
安全 Linux 网络安全
Linux系统初步设置本地Git环境和生成SSH密钥的步骤。
现在您的Linux系统已经配置好了Git环境,并创建并添加了SSH密钥,可以安全地与远端仓库进行交互,无论是克隆、推送还是拉取操作。此过程确保了数据传输的安全并使版本控制流程更为顺畅。使用Git时应考虑定期更新并管理您的凭据,以确保安全性。
1887 0
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
11282 1
|
人工智能 IDE 编译器
idea如何使用AI编程提升效率-在IntelliJ IDEA 中安装 GitHub Copilot 插件的步骤-卓伊凡
idea如何使用AI编程提升效率-在IntelliJ IDEA 中安装 GitHub Copilot 插件的步骤-卓伊凡
3622 15
idea如何使用AI编程提升效率-在IntelliJ IDEA 中安装 GitHub Copilot 插件的步骤-卓伊凡
|
文字识别 网络协议 开发工具
GitHub封锁?推荐5个国产的Git仓库替代平台
近日,GitHub对中国区IP的部分限制引发了广泛关注。未登录用户被拒,已登录用户功能受限,南北网络环境差异更显“内卷”。为应对这一挑战,本文推荐了多个国产Git平台:Gitee(码云)、GitCode(CSDN旗下)、CODING(腾讯系)、CodeUP(阿里云支持)及微信代码管理工具。这些平台功能全面、稳定性强,是开发者迁移项目的理想选择。通过同步代码、配置CI/CD流水线等简单步骤,可确保项目平稳过渡。此次事件提醒我们,掌握核心技能与支持国产平台同样重要!
22276 11
|
安全 Linux 网络安全
在Linux(CentOS和AWS)上安装更新的git2的方法并配置github-ssh
经过以上这些步骤,你现在就能在GitHub上顺利往返,如同海洋中的航海者自由驰骋。欢迎你加入码农的世界,享受这编程的乐趣吧!
768 10
|
网络安全 开发工具 git
解决 Git 访问 GitHub 时的 SSL 错误
通过上述步骤,可以有效解决 Git 访问 GitHub 时的 SSL 错误。推荐优先更新 CA 证书和正确配置 Git 使用 CA 证书,避免禁用 SSL 验证。如果问题持续,可以切换到 SSH 方式访问 GitHub,确保连接的安全性和稳定性。希望这些内容对您的学习和工作有所帮助。
8536 4