Github简易使用指南
来源:互联网 发布:linux 获取项目路径 编辑:程序博客网 时间:2024/06/06 13:21
设置用户信息
$ git config --global user.name "test"//给自己起个用户名$ git config --global user.email "test@gmail.com"//填写自己的邮箱
====================创建一个项目========================
1. 回到github首页,点击页面右下角“New Repository”
填写项目信息:
project name:Project
点击“Create Repository” ; 现在完成了一个项目在github上的创建。
2. 我们需要使用git在本地创建一个相同的项目。
$ makdir ~/Project //创建一个项目Project$ cd ~/Project //打开这个项目$ git init //初始化 $ touch README$ git add README //更新README文件$ git commit -m 'commit test'//提交更新,并注释信息“commit test'//” $ git remote add origin git@github.com:test/Project.git //连接远程github项目 $ git push -u origin master //将本地项目更新到github项目上去
如何上传本地某个工程文件夹
右键git bash here
git init
git remote add origin git@github.com:yourname/project.git
git pull origin master
把这个主分支拉过来
此时由于repository里面只有一个readme所以没冲突,这一步为空
git add .
把文件夹下的所有的文件加载到缓冲区,有的说是index
git commit -m “message”
message是你这次提交的备注,比如为啥提交啊,你改了哪里啊等等
git push origin master
这一步后才会在服务器上看到你的工程
------------------------------------关于可能出现的错误----------------------------------
1.在执行
$ git remote addorigin git@github.com:defnngj/hello-world.git
错误提示:fatal: remote origin already exists.
解决办法:
$ git remote rm origin
然后在执行:$ git remote add origin git@github.com:defnngj/hello-world.git 就不会报错误了
2. 在执行
$ git push origin master
错误提示:error:failed to push som refs to.......
解决办法:
$ git pull origin master // 先把远程服务器github上面的文件拉下来,再push 上去。
- Github简易使用指南
- Github使用指南
- Github使用指南
- Github使用指南
- Github使用指南
- Github使用指南
- Github使用指南
- github使用指南
- github使用指南
- Github使用指南
- Github使用指南
- github使用指南
- Github使用指南
- GitHub使用指南
- BOOTSTRAP简易使用指南
- vim简易使用指南
- git 简易使用指南教程
- Bootstrap简易使用指南
- vijos 1250 最勇敢的机器人
- GNU C 、ANSI C、标准C、标准c++区别和联系
- μCOS-ii初学心得
- 如何取链接带的参数
- 日常生活
- Github简易使用指南
- hdu 1017
- 中美军事力量对比
- STM32 学习之TIM
- uC/OS II学习时的一个重要函数 OSInit( )
- java之final关键字
- HDU 1078 FatMouse and Cheese【第一道记忆化搜索题】
- μC/OS-II基本原理简介
- Rxjava之FlatMap()的运用