GitHub的简单使用

自己是一个linus的小白,所以即使看别人写的关于GitHub的命令文章,自己还是一头雾水,所以这一篇就记录一下,自己在用Github的常用命令:



创建Repository可以参考官方的参考步骤【3】,只是需注意的它上面的第一步中mkdir ~/Hello-world,一般创建在C盘用户文件下,可以更改为在自己的文件夹下创建。

在git remote add origin https://github.com/username/Hello-World.git中,私人的和公共的是不一样的,可以参考【4】。

添加文件git add filename, 或改文件夹下的所有文件git add -A。删除文件git del filename。

在添加或删除文件后,需修改Reporsitory的步骤是先加评论git commit -m 'the commit', 然后git push origin master,如果出现错误这个git pull origin master命令超级有用。(果然是应该在做的过程中写博客,不然就是害死人。在若干天之后再写就会忘记了是参考了那篇博客,也没有截图大哭

我操,这个参考[3]换成客户端的模式了。下面记录一下用命令的形式:

第一步到目标文件夹下:$ git init

第二步建立与远程仓库的链接:git remote add origin git@github.com:useernanme/**.git


当向.gitignore添加忽略文件之前一定要保证那些文件未被git跟踪,否者可以使用git rm --cached filenmae将它们从索引中删除[7]。

参考:

【1】 Git 常用命令详解(二) http://blog.csdn.net/sunboy_2050/article/details/7529022

【2】GIT使用笔记FOR Windows http://blog.csdn.net/patdz/article/details/7785907

【3】Create A Repo https://help.github.com/articles/create-a-repo

【4】git/github学习笔记 http://www.cnblogs.com/fnng/archive/2011/08/25/2153807.html

【5】“did you run git update-server-info” error on a Github repository http://stackoverflow.com/questions/9343189/did-you-run-git-update-server-info-error-on-a-github-repository

【6】Git教程 http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

【7】Git忽略文件 http://www.cnblogs.com/shangdawei/archive/2012/09/08/2676669.html

【8】忽略特殊文件 http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013758404317281e54b6f5375640abbb11e67be4cd49e0000

【9】如何清洗 Git Repo 代码仓库 https://blog.eood.cn/how-to-clean-up-git-repo

【10】Reduce repository size https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html (减小仓库大小)

[11]  How to Use Git and GitHub https://www.udacity.com/course/how-to-use-git-and-github--ud775

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值