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

相关文章
|
6天前
|
开发工具 git
Git项目如何配置,如何上传至GitHub。其详细步骤
Git项目如何配置,如何上传至GitHub。其详细步骤
12 0
|
6天前
|
网络安全 数据安全/隐私保护
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
|
6天前
|
存储 开发工具 git
|
6天前
|
开发工具 数据安全/隐私保护 C++
vs2019中同步到github上的用户名错误_控制面板和vs的git全局设置重新登录
vs2019中同步到github上的用户名错误_控制面板和vs的git全局设置重新登录
17 0
|
6天前
|
前端开发 JavaScript 网络安全
Git(3) 使用Github管理项目
Git(3) 使用Github管理项目
28 0
|
6天前
|
开发工具 git
git如何创建新分支,GitHub默认分支是main怎么连上
git如何创建新分支,GitHub默认分支是main怎么连上
23 0
|
6天前
|
开发工具 git
对于github不同的分支main或者master,git拉取代码的时候怎么拉取不同分支的代码
对于github不同的分支main或者master,git拉取代码的时候怎么拉取不同分支的代码
24 1
|
开发工具 git
Git Pull强制覆盖本地文件
在有些场景下为了避免代码冲突,需要强制使用远程代码覆盖本地代码,比如自动部署,GitHub的webhook 解决方法 git fetch --all git reset --hard origin/master git pull ...
3606 0
|
6天前
|
缓存 数据可视化 网络安全
Git命令大全
Git命令大全
62 1
|
6天前
|
开发工具 git
Git教程:深入了解删除分支的命令
【4月更文挑战第3天】
73 0
Git教程:深入了解删除分支的命令