git使用笔记

学习视频
https://www.bilibili.com/video/BV12a4y1H7Rq?p=12

git使用笔记_第1张图片
git命令大全https://blog.csdn.net/halaoda/article/details/78661334

简易的命令行入门教程:
Git 全局设置:

git config --global user.name "ThinkerWing"
git config --global user.email "email"
创建 git 仓库:

mkdir ThinkerWing
cd ThinkerWing
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/thinkerwing/ThinkerWing.git
git push -u origin master
已有仓库?

cd existing_git_repo
git remote add origin https://gitee.com/thinkerwing/ThinkerWing.git
git push -u origin master
git commit 提交
git add 添加至暂存区
git branch 分支管理
git push 推送至远程版本库
git merge 分支合并
git status 显示工作区文件状态
git pull 拉回远程版本库的提交
git checkout 检出到工作区、切换或创建分支

git remote add origin https://gitee.com/thinkerwing/ThinkerWing.git
git使用笔记_第2张图片
在这里插入图片描述
git使用笔记_第3张图片
git使用笔记_第4张图片
!](https://img-blog.csdnimg.cn/20210410104510834.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RhZGR5a2Vp,size_16,color_FFFFFF,t_70)
git使用笔记_第5张图片
git使用笔记_第6张图片

PS F:\web\git-demo> git pull origin master 
 * branch            master     -> FETCH_HEAD
Updating 65b756e..96a28f2
Fast-forward
 a.html | 3 +++
 1 file changed, 3 insertions(+)
PS F:\web\git-demo> git commit -m "code by firstman" 
[firstman 1c8b417] code by firstman
 1 file changed, 2 insertions(+)
PS F:\web\git-demo> git push
fatal: The current branch firstman has no upstream branch.
To push the current branch and set the remote as upstream, use      

    git push --set-upstream origin firstman

PS F:\web\git-demo>  git push --set-upstream origin firstman
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.

你可能感兴趣的:(笔记,git)