02_Git简单使用

  1. 注册git帐号

  2. 创建git 仓库 输入仓库名

  3. 在本地安装git(以centos7 为例)

# yum install git -y
  1. 配置git的全局变量(这里的name跟email只是在你提交代码的时候会显示的,方便别人知道是谁提交的)
# git config --global user.name "your name"
# git config --global user.email "your_email@youremail.com"
  1. 查看git配置
[root@VM_0_5_centos studypy]# git config --list
user.name=lieman
user.email=944031246@qq.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/lieman/studypy.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
  1. 按照git官方的配置输入一下命令就可以成功将本地的git跟远程github仓库连接并上传
echo "# studyxx" >> README.md
git init     #在你当前的文件夹中初始化git,会生成.git文件夹里面保存git的一些配置
git add README.md     #将README.md这个文件添加到git
git commit -m "first commit"     #提交
git remote add origin https://github.com/lieman/studyxx.git     #将远程仓库跟本地的git文件夹关联
git push -u origin master    #将本地的git推送到远程仓库,下面会要求输入你github的帐号密码,除非你做了ssh免密认证

转载于:https://my.oschina.net/u/4023720/blog/2876440

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值