欢迎访问『www.cnblogs.com/blog-ice』

git config --global user.email xxx@xx.com
git config --global user.name xxx
git config --global http.sslVerify false

创建 git 仓库:
mkdir spring-boot
cd spring-boot
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://xxx.git
git push -u origin master


已有仓库
cd existing_git_repo
git remote add origin https://xxx.git
git push -u origin master


git clone https://xxx.git


git branch -a 查看远程分支
git restore file 还原一个文件
git reset --soft HEAD^ 取消最近commit

git reset --hard

运行命令 git reset --hard 刚刚复制的commitId,就可以成功回退到那个版本。

--撤销push
git log
git reset --soft commit-id
git log
git push origin master --force


git checkout 分支名称

 

文件名太长

git config --system core.longpaths true

posted on 2021-09-02 08:34  仙路尽头谁为峰  阅读(35)  评论(0编辑  收藏  举报
这里是自由发挥的天堂