github设置 username_ubuntu下github的使用

一、注册github账号。

请自行进入https://github.com进行注册。

二、安装git及一些基本设置。

1.安装git

sudo apt-get install git

2.设置github账号信息

git config --global user.name "your name here"

git config --global user.email "your email@example.com"

这里“your name here”输入的是你注册github的用户名,这一步是设置你提交时,默认的用户名。

类似的,“your email@example.com”是你注册github账号的邮箱,也可以用别的邮箱,不过用别的邮箱时,需要在github主页上设置里面把用的邮箱添加进去。

3.设置让credential helper 帮助我们在一定时间内在内存中保存我们的code,其中第二行为设置超时的时间

git config --global credential.helper cache

git config --global credential.helper 'cache --timeout=3600'

三、建立新的repository

https://github.com/new

d09f2002dd43d67a4b1883b765430a39.png

四、针对一个新建立的repository的操作(已有项目,跳过此小节,直接看第五节)

1.先建立一个目录,该目录与你新建的repos有关

mkdir ~/test_project
cd ~/test_project
git init //初始化一个空的git repository
touch README //README 文件用于描述该项目

2.提交刚刚加入的README文件

git add README

git commit -m "first commit" //-m 用于指定本次提交的描述信息

3.提交到repository

git remote add origin https://github.com//username//test_project.git

之后会要求输入用户名和密码,输入即可

提交命令是:

git push -u origin master

五、已有项目

1. 先clone下来

git clone https://github.com/username/test_project.git

2. 进入到test_project文件中,进行文件修改,删除等操作

3.提交

git add .   // .代表添加所有文件

git commit -m "对文件操作的简易描述"

git push -u origin master

参考:

ubuntu 下github使用(简要过程)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值