Github Desktop for Windows上传本地项目
总想在自己的开发生涯中留下点什么,怕以后的以后都忘记了。看到很多的牛人都喜欢在github上折腾自己的project,与人方便自己方便。
---代码无可期,梦想尤可违。但使志常存,亦复为君启。
一、准备工作
1. 登录Github官网:github.com/,注册账号并登录;

2. 安装github桌面版:desktop.github.com/,根据电脑的系统版本下载,the blog just for Windows;

3. 创建个人仓库,在github登录后,在主界面,点击下图创建;


创建完成后的repository,如图示

4. 安装git客户端
登录:git-for-windows.github.io/,下载并安装git客户端,安装过程一直点击“next”即可,待成功安装后,点击任意一个文件夹,都会出现“Git Gui Here”和“Git Bush Here”则表明安装成功。

二、上传本地project至Github
通俗意义上,github作为一个网络服务器端,而git相当于一个客户端,在实际的操作过程中,git繁琐的命令行确实给广大的开发者带来一定的不便,因此采用github desktop将本地的项目传递到服务器端。
1.本地新建test文件夹为例,如F:\test,点击主界面的红色框框内的“create a new project......”,然后找寻“test”所在的文件夹,进行“create repository”。


2. 会出现以下error,这个问题是因为没有对git进行配置的原因,在github desktop 的菜单栏“File”中找到“Options”,进行登录,找到“Git”选项,此时已经有mail和user name,但是还是不行,此时我们需要重新对git进行配置。

3. 找到安装好的Git Bush的安装目录,并打开“git-bush.exe”

按照上面error的信息输入以下两行代码:
git config --global user.email "youremail@***.com"
git config --global user.name "****"
突然出现以下问题,无法设置?表明电脑上以前有包含这个配置文件或者是其他的一些软件包含这个配置文件,而且在电脑的“环境变量”或者是在“用户变量”中有设置“HOME”属性。

解决办法,桌面右击“计算机”,找到“环境变量”,在“user的用户变量中”,找到“HOME”,将变量“HOME”的值修改为git的安装目录。

再次进行配置,问题得到解决。

以上为所有需要上传的project统一email和name,如果单纯的想为某一个project更改email或者name,可以右击这个project所在的文件夹,找到Git Bush,并且输入:
git config user.email "youremail@***.com"
git config user.name "******"
4. 上传本地新建的project
待以上准备工作做好后,点击“Publish repository”,然后对repo作说明和选择即可,项目发布到github.com时间上会有延迟,前面做了几次都误以为没有成功,等待片刻,多刷新即可。


然后进入github.com,刷新即可显示本地上传的project。

5. 上传更新文件
本地测试的project中新建一个test.txt,github desktop中即会出现这个新增的文件,可以在侧边栏发现其更新的状态等。

刷新github如果还是没有看到新增加的文件,此时回到github desktop点击“Publish repository”,出现红框中的内容,刷新后即可。


三、删除repository
找到这个repo 的settings设置,将网页拖拽到最底部,按照提示输入与repo相同的名字,删除即可。

四、后记
文中的图片皆为保存到本地word中的截图,上传至简书经压缩清晰度比较低,给各位带来的不便还请谅解。后续我将根据现有project中的一些知识点,个人认为比较实用性的技术点做记录说明。
文中如有错误还请各位帮忙指正,谢谢!