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

相关文章
|
13天前
|
网络安全 开发工具 git
解决fatal:remote error:You can’t push to git://github.com/username/*.g
通过上述诊断与修复步骤,绝大多数的推送错误都能得到有效解决,确保您的Git工作流顺畅无阻。
15 1
|
24天前
|
Unix Shell 网络安全
git学习六:(bug总结)git@github.com: Permission denied (publickey).等
本文是关于解决在使用Git和GitHub时遇到的“git@github.com: Permission denied (publickey)”错误的指南。文章提供了详细的步骤,包括确认SSH Agent运行状态、检查密钥配置、确保密钥匹配、验证仓库URL、检查权限和代理设置,以及配置SSH文件。这些步骤帮助用户诊断并解决SSH认证问题。
62 0
|
2月前
|
开发工具 git 开发者
掌握版本控制的艺术:Git 与 GitHub 的高效使用指南
在软件开发中,版本控制对于代码管理和团队协作至关重要。本文详细介绍了 Git 的核心概念与命令,包括初始化、创建仓库、文件跟踪、分支管理和远程仓库操作。同时,探讨了如何利用 GitHub 进行项目组织、代码审查及自动化工作流。通过遵循最佳实践,如频繁提交、清晰的信息记录和合理使用分支,开发者可以提升工作效率和团队协作能力,确保项目的持续成功。
|
2月前
|
Shell 网络安全 开发工具
Git,GitHub,Gitee&IDEA集成Git
Git提交项目到GitHub简洁版、版本控制、安装、常用命令、分支、团队协作机制、Github、Gitee远程仓库、IDEA集成Git、IDEA集成Github、IDEA集成Gitee
Git,GitHub,Gitee&IDEA集成Git
|
2月前
|
Shell 网络安全 开发工具
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
|
3月前
|
Shell 开发工具 git
使用 Shell 代码简化 Git 步骤
【8月更文挑战第23天】本文介绍通过Shell脚本简化Git操作的方法:1) 使用`gitc "提交信息"`可一键完成代码提交与推送至远程仓库;2) 执行`gitpull`即可从远程仓库拉取最新代码并合并到当前分支;3) 输入`gitnewbranch 分支名称`快速创建并切换到新分支。将这些自定义函数加入`.bashrc`或`.zshrc`等配置文件后,即可随时调用简化版Git命令。
|
4月前
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
992 1
|
5月前
|
开发工具 git
使用Git使用步骤
使用Git使用步骤
|
4月前
|
网络安全 开发工具 git
使用git克隆仓库报错:Warning: Permanently added‘github.com’ to the .....(ssh )
所以,你可以安全地忽略这个警告,它不会影响到你使用git克隆仓库。如果你已经成功克隆了仓库,那么一切都在正常工作。如果你在克隆过程中遇到其他问题,那可能需要查看具体的错误信息来解决。
98 0
|
5月前
|
Shell 开发工具 git
如何使用git上传代码github仓库
如何使用git上传代码github仓库