开源相关
开放源代码(Open source code)也称为源代码公开,指的是一种软件发布模式。
Github
GitHub是一个利用Git进行版本控制、专门用于存放软件代码与内容的共享虚拟主机服务。
windows下的准备工作:
- windows环境下安装github for windows
- 注册github账号
- 登录 github for windows
- 下载git for windows.习惯命令行的可以用这个
在 github for windows上clone github的代码时出现无法连接错误’fatal: unable to access ‘xxx/xxx/xxx ‘: Failed to connect to github.com’.原因是公司的网络设置了代理proxy = http://swg.tieto.com:8080.需要在.gitconfig文件下(路径是C:\Users\[user name]\)添加对应代理:
尝试clone github上的一个repo到本地,clone 成功:
linux下的准备工作:安装git。公司的是CentOS,已经安装了git,可以跳过,相关安装指令如下:
//ubuntu
apt-get install git
//CentOS
yum install git
- 配置git用户信息:
git config --global user.name "xxx"
git config --global user.email "xxx@xxx.com"
- 开启ssh服务,CentOS默认开启:
//Ubuntu
apt-get install ssh
//CentOS 查看 SSH 服务状态:
ps -e | grep sshd
- 生成ssh key
ssh-keygen -t rsa -C "xxx@xxx.com"
- 查看对应公钥和私钥,将公钥内容复制到github上
- 检查是否能连上github,出现Permission denied问题,解决方法是执行如下指令:
ssh-add
- 尝试clone一个github上的repo到本地,成功,后续的就是git的常规操作
其他常用的开源社区
Stack Overflow
CodeProject - For those who code
SourceForge - Download, Develop and Publish Free Open Source Software