Django世界-迈出第12步-Git

Dajngo学习

github

在这里插入图片描述

  1. 设置账号和密码:
git config --global user.name Gavin188
git config --global user.email 63292933@qq.com
  1. 查看用户的账号和密码:
git config --global -l 
  1. 修改配置文件
vim ~/.bash_profile
#添加代理
export http_proxy ='http://name:password@ip:port'
export htpps_proxy='http://name:password@ip:port'
  1. 设置git代理
git config --global http.proxy name:password@ip:port
git config --global https.proxy name:password@ip:port
  1. 下载git文件
git clone https://github.com/Gavin188/WGT.git;
  1. 提交文件
#创建文件
mkdir wgt
#提交文件
git add wgt
#提交到本地
git commit 
git commit -m '备注'
#提交到git
git push -u origin master
# 更新代码
git pull 
  1. 查看工作目录和暂存区的差别
git diff
  1. 创建并切换分支
git checkout -b newbranch 

10 本地代码上传到GitHub
https://www.jianshu.com/p/7798186523ee

出现的问题

  • 提交文件
On branch master
        Your branch is up to date with 'origin/master'.
        nothing to commit, working tree clean

解决方案:https://www.jianshu.com/p/7798186523ee

  • 在上传本地代码到github仓库时,
$ git remote add origin https://github.com/jennaqin/jennaqin.github.io.git
    fatal: remote origin already exists.

先移除
git remote rm origin
再次添加
git remote add origin https://github.com/jennaqin/jennaqin.github.io.git

  • fatal: Couldn't find remote ref master'

翻译过来就是:致命的:无法找到远程参考主,也就是报错的意思。错误的提示内容意思是找不到需要连接的对象。
-解决办法:
git remote rm origin
git remote add origin XXXX

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值