Git 和 Github 使用记录

前言

本文的目的是为了帮助更快的上手Git将资源上载至Github

什么是Git

Git 是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。1

Git 的安装、配置、使用

这一部分网上教程很多,这里给出两篇不错的借鉴

  • Git初步入门 :here 2
  • github的简单使用 :here 3

使用IDEA或PyCharm管理

该部分前提是Git安装成功能正常使用<该部分参考自:here4>

PyCharm配置Git和Github

  • 在这里插入图片描述
    在这里插入图片描述

Create Git Repository

VCS –>Import into Version Control –>Create Git Repository –>选择项目文件夹
在这里插入图片描述

上传项目

VCS –>Import into Version Control –>Share Project On GitHub–>填写名称和描述
在这里插入图片描述

  • 至此就可以到自己的GitHub上查看该项目

进行修改上传操作

参考:here
遵循git的方式:先add后commit最后push

错误处理

Can’t finish GitHub sharing process
Successfully created project ‘GitHubDemo’ on GitHub, but initial commit failed:* Please tell me who you are. Run git config –global user.email “you@example.com” git config –global user.name “Your Name” to set your account’s default identity. Omit –global to set the identity only in this repository. fatal: empty ident name (for ) not allowed during executing git -c core.quotepath=false commit -m “Initial commit xxx” –

  • 解决:需要设置用户名和邮箱标识,在git-cmd中输入以下命令:
    git config --global user.name “xxxxxx”
    git config --global user.email “xxxxxxxx”
    在这里插入图片描述

连接GitHub超时问题

  • 打开cmd :ping github.com
  • 若不可以访问,则修改host文件,进入 C:\Windows\System32\drivers\etc 目录下,找到hosts文件,加入以下两行:
    192.30.253.113 github.com
    151.101.112.249 github.global.ssl.fastly.net
    然后更新一下DNS缓存,如下:
    cmd (命令提示符) 中输入: ipconfig /flushdns

学无止境,作为小白继续努力!!!!!!
谢谢浏览,希望能够帮到大家。
欢迎大家留言,提出问题和意见。

作者:卢松林
许昌学院计算机科学与技术专业


  1. Git 百度百科 ↩︎

  2. Git初步入门 ↩︎

  3. github的简单使用 ↩︎

  4. IDEA连接github 并上传项目使用 ↩︎

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值