Linux shell提交github安装以及使用

•安装
yum  install git
git config  //git配置修改
•Linux中创建pub key,导入github
•
git init 创建新项目并上传(或者git clone)
•
建立新文件,
git add
•
git commit
•
git push

两项基本配置:

#配置使用
git仓库的人员姓名
git config --globaluser.name “Mike"
#配置使用
git仓库的人员email
git config --global user.emailyou@xyz.com

本地无项目是这样操作(与clone有点区别):

#
初始化一个版本仓库
git init
cd existing_folder
git init
git remote  add origin git@DX2:kennethxian/testproject.git
//remote add重命名指令
git add  . 
git commit 
git push -u origin master

遇到的错误以及解决办法:

[root@HTY-1 SortedPriceName]# git push
To git@github.com:crazyyanchao/SortedNmaePrice.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:crazyyanchao/SortedNmaePrice.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

以上报错通过更新本地仓库解决,之后重新提交ok!

[root@HTY-1 SortedPriceName]# git pull origin
You asked to pull from the remote 'origin', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
[root@HTY-1 SortedPriceName]# git pull origin master
From github.com:crazyyanchao/SortedNmaePrice
 * branch            master     -> FETCH_HEAD
Merge made by recursive.
 README.md |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 README.md
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

马超的博客

谢谢大佬的赞赏 :)

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值