Git 和 Github 使用记录
记录Git和Github使用记录
前言
本文的目的是为了帮助更快的上手Git将资源上载至Github
什么是Git
Git 是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。1
Git 的安装、配置、使用
这一部分网上教程很多,这里给出两篇不错的借鉴
使用IDEA或PyCharm管理
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 “[email protected]” 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
学无止境,作为小白继续努力!!!!!!
谢谢浏览,希望能够帮到大家。
欢迎大家留言,提出问题和意见。
作者:卢松林
许昌学院计算机科学与技术专业