github指令(待续)

welcome to github!!!


目录


新建仓库

初次使用Git的设置

1.用户配置

 git config --global user.name "用户名"
 git config --global user.email 邮箱

2.生成ssh key

ssh-keygen -t rsa -C "邮箱"
这条指令成功后,主目录(~)会生成.ssh的隐藏文件夹,里面包含id_rsa和id_rsa.pub。

3.添加密钥到github

vi ~/.ssh/id_rsa.pub

这里写图片描述

将id_rsa.pub中ssh密钥上传至github,其中title可以随意取。

4.测试

ssh -T git@github
出现这句话就表示成功。

这里写图片描述

push本地项目到Github仓库

1.初始化仓库(repository)

git init
在项目目录下执行

2.添加文件

将文件添加至暂存区:
git add .
(git status可以查看暂存区文件)

3.提交项目

git commit -m "first commit"

4.添加仓库

对于新建立的工程,要在github上添加仓库	

这里写图片描述

git remote add origin git@github.com:yourName/yourRepo.git

5.push到仓库

 git push -u origin master
 (-u参数会把本地的master分支和远程的master分支关联起来)

常用命令说明


配置文件

[alias]
        co = checkout
        br = branch
        ci = commit
        st = status
        f  = format-patch
        sm = send-email
[user]
        email = xxx
        name = xxx
[core]
        editor = vim

git 设置和取消代理

设置ss代理
git config --global http.proxy 'socks5://127.0.0.1:1080'

git config --global https.proxy 'socks5://127.0.0.1:1080'

设置http代理
git config --global https.proxy http://127.0.0.1:1080

git config --global https.proxy https://127.0.0.1:1080

取消代理
git config --global --unset http.proxy

git config --global --unset https.proxy

git bisect

git bisect start [终点] [起点]
git bisect good / git bisect bad
git bisect reset
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值