How to use GitHub with terminal commands[命令行下使用GitHub]
Step 1:安装Git
apt-get install git git config --global user.name 'deyin' # 请替换成你在GitHub上注册的用户名 git config --global user.email 'deyinx.chen@gmail.com' #请替换成你在GitHub上注册时使用的邮箱
Step 2:创建一个Repo
1.打开浏览器,登录到GitHub,创建一个Repository,名字为helloworld.
2.如下:
cd ~ mkdir github_workspace cd github_workspace mkdir helloworld cd helloworld git init touch README echo "This is my first github repo named helloworld">README git add README git commit -m 'add file README' # 到这里,所有的操作都是本地操作
git remote add origin https://github.com/deyin/helloworld.git # 准备添加一个origin版本到远程代码仓库,origin可以是任意名字,比如:a
git push origin master # 将上一行的origin版本提交到master,假如上一行版本名字为a,则对应的命令:git push a master
3.刷新浏览器,你会发现helloworld仓库下面多了一个README文件了.