在mac下如何使用github
方法/步骤
1
新建github账户
2
新建Repository,如下图:
3
建立连接github的秘钥打开mac的shellcd ~mkdir .sshcd .sshssh-keygen -t rsa -C xxxxx@xxx.com(你的github账户)在github中添加ssh,如下图:
4
提交代码到githubgit config --global user.name 'xxx'git config --global user.email 'xxxxx@xxx.com'在你的项目目录下git initgit remote add origin https://github.com/xxxxx/xxxxxx.gitgit add .git commitgit push origin master
注意事项
1
git remote add origin https://github.com/xxxxx/xxxxxx.git中得https地址就是你的github中的repository地址
2
如果不想全部提交,可以在目录下增加一个.gitignore文件,里面写上不想add的文件或目录