分类 tool articles

git基础介绍

Git配置

1
2
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"

git config命令的--global参数,表明这台机器上的所有Git仓库都会使用这个配置,也可以对某个仓库指定不同的用户名和邮箱地址。

……

Continue reading

git提交代码到github提示失败

1、报错信息

Connection reset by 20.205.243.166 port 22 fatal: Could not read from remote repository.  Please make sure you have the correct access rights and the repository exists.

2、处理方案

尝试将host文件中添加
192.30.255.112 github.com git
185.31.16.184 github.global.ssl.fastly.net
……

Continue reading

git常用的操作

git常用的操作语法介绍

1、回归合并代码的请求

git checkout . && git clean -xdf

2、强制删除本地的代码分支

git branch -D branchName

3、检出代码到本地

git checkout -b 本地分支名 远程分支名
……

Continue reading

git本地未提交被丢弃的文件如何找回

1、问题背景

写了一天代码,下班的时候随手关闭sourceTree,然后在关闭之前顺手执行了丢弃操作。(以为是测试项目的代码,无需保留)。下一秒猛地意识到是今天的项目代码。突然紧张起来了。

……

Continue reading