托管项目到GitHub[ Linux版本 ]


下载安装git[ linux]

下载安装最新版本的 Git.
#sudo apt-get install git


设置Git


用户名Username
首先你需要告诉Git你的名字,这样在提交的时候才可以辨别是你提交的。
git config --global user.name "lixiaolong"

邮箱Email
git config --global user.email "lixiaolong@163.com"

Overriding settings in individual repos
缓存密码Password caching

git config --global credential.helper cache
# Set git to use the credential memory cache
By default git will cache your password for 15 minutes. You can change this if you like.


git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)


创建REPO

Congratulations! You have successfully created your first repository!

第一步:在github上创建一个REPO

第二步:克隆REPO到本地

git clone https://github.com/userName/yourRepo.git


git init
# Sets up the necessary Git files


第三步:

git remote add origin https://github.com/userName/yourRepo.git
# Creates a remote named "origin" pointing at your GitHub repository


//为第一次提交添加注释

git commit -a -m 'first commit '


第一次提交代码

git push --set-upstream origin master


以后提交代码直接就是一下的几个步骤:

git status //查看状态

git commit -a//添加注释

git push//提交代码



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值