`
guafei
  • 浏览: 328058 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

github使用

 
阅读更多
git的key申请:
https://help.github.com/articles/generating-ssh-keys

把申请好的.pub文件和邮箱告诉管理员。

git client :smartGit 
pull:从远程拉代码
push:从本地提交代码到远程
sys:查看差异
commit:提交到本地

下载git上的代码:git clone git@iteam.taobao.ali.com:TBWantu.git

关于github的使用:
请看附件



网上转的:http://hi.baidu.com/feipu123/item/027e4aff34c51a5cc9f337a3

1.创建一个新的repository:
先在github上创建并写好相关名字,描述。
$cd ~/hello-world        //到hello-world目录
$git init                     //初始化
$git add .                   //把所有文件加入到索引(不想把所有文件加入,可以用gitignore或add 具体文件)
$git commit               //提交到本地仓库,然后会填写更新日志( -m “更新日志”也可)
$git remote add origin git@github.com:WadeLeng/hello-world.git        //增加到remote
$git push origin master    //push到github上
2.更新项目(新加了文件):
$cd ~/hello-world
$git add .                  //这样可以自动判断新加了哪些文件,或者手动加入文件名字
$git commit              //提交到本地仓库
$git push origin master    //不是新创建的,不用再add 到remote上了
3.更新项目(没新加文件,只有删除或者修改文件):
$cd ~/hello-world
$git commit -a          //记录删除或修改了哪些文件
$git push origin master  //提交到github
4.忽略一些文件,比如*.o等:
$cd ~/hello-world
$vim .gitignore     //把文件类型加入到.gitignore中,保存
然后就可以git add . 能自动过滤这种文件
5.clone代码到本地:
$git clone git@github.com:WadeLeng/hello-world.git
假如本地已经存在了代码,而仓库里有更新,把更改的合并到本地的项目:
$git fetch origin    //获取远程更新
$git merge origin/master //把更新的内容合并到本地分支
6.撤销
$git reset
//------------------------------常见错误-----------------------------------
1.$ git remote add origin git@github.com:WadeLeng/hello-world.git
错误提示:fatal: remote origin already exists.
解决办法:$ git remote rm origin
然后在执行:$ git remote add origin git@github.com:WadeLeng/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 基础概念 1. **仓库(Repository)**:在 GitHub 上,你的项目就是一个仓库,它包含了所有的...

    github使用教程github使用教程

    github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程...

    Github使用教程.zip_zip压缩包

    Github使用教程.zip 身为程序员,怎么能不会使用github呢

    github使用文档-改进版1

    github使用文档 github使用文档

    moredoc-github使用教程

    moredocgolangdochub github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    IoTLink-github使用教程

    SpringBootVueMybatisRabbitMqMysqlRedis + github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    F2-github使用教程

    HTML5 Canvas github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    GitHub使用教程分享

    github使用教程GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub使用教程分享GitHub...

    novel-github使用教程

    novel Java Spring Boot 3 + Vue 3 Java github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    github使用方法(关注,持续更新)

    GitHub 使用方法详解 GitHub 是一个基于 Git 的代码托管平台,可以帮助开发者们更好地管理和协作开发项目。以下是 GitHub 使用方法的详细解释: 一、注册 GitHub 账号 在使用 GitHub 之前,需要注册一个 GitHub ...

    wukong-robot-github使用教程

    wukong-robot / ChatGPT github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    Rime键道输入法-github使用教程

    6RimeRIME github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    WukongCRM-11.0-JAVA -github使用教程

    CRM-Spring Cloud Alibaba +vue ElementUICRM+ github使用教程 github使用教程 github使用教程 github使用教程 github使用教程

    GitHub使用教程.zip

    github使用教程GitHub使用教程.zip

    GitHub使用技巧.zip

    GitHub使用技巧.zip 1.在线编辑上传 2.留言时可以从剪贴板粘贴图片。会被上传到云端,并在markdown中整齐的显示出来 3.格式化代码 5.评论中超链接到另一个评论 6.文章中超链接到某行代码 7.项目板

    github使用教程.txt

    github使用教程

    github使用教程.rar

    github使用教程

Global site tag (gtag.js) - Google Analytics