Git学习笔记,来自慕课网课程

编程入门 行业动态 更新时间:2024-10-17 21:21:16

Git<a href=https://www.elefans.com/category/jswz/34/1770117.html style=学习笔记,来自慕课网课程"/>

Git学习笔记,来自慕课网课程

下载windows git

双击安装,一直下一步,完成。

git是分布式控制版本系统

配置用户信息

git config --global user.name "xxx"

git config --global user.email "xxx"

打开Git Bath

不同windows 系统打开方式可能不同

查看git信息(用户名,密码)

git config --list

客户端GUI界面使用Sourcetree

下载Sourcetree

/

参照人家的安装Sourcetree教程

Sourcetree项目查看地址

初始化版本库

git init

添加文件到版本库

git add

git commit

查看仓库状态

git status

查看仓库状态

  1. 所在分支为master
  2. (没有要提交的内容,工作树已清除)所有本地的修改都已经提交到当前的分支

把暂存区的修改回退到工作区

git reset HEAD bash_demo.txt

确认回退工作区的内容
 git checkout -- bash_demo.txt

远程仓库

创建SSH key

ssh-keygen -t rsa -C "邮箱"

添加远程仓库

本地仓库init之后关联远程仓库

git remote add origin git@github:xxxx

--(allow-unrelated-histories)允许不相关的历史记录

git pull origin master --allow-unrelated-histories

推到远程仓库并指定分支master

git push -u origin master

克隆仓库

git clone git@github:xxxx

标签管理

查看所有标签

git tag

创建标签

git tag name

指定提交信息

git tag -a name -m "comment"

删除标签

git tag -d name

标签发布

git push origin name

git cat 查看文件命令乱码

cat test.txt | iconv -f GBK -t UTF-8 

windows环境下新建.txt文件,使其默认以UTF-8编码

参照博客使用Notepad++创建.txt文件

or create a new repository on the command line

echo "# 2019-5-13-test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin .git
git push -u origin master
or push an existing repository from the command line

git remote add origin .git
git push -u origin master

 

更多推荐

Git学习笔记,来自慕课网课程

本文发布于:2024-02-26 02:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1701093.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:学习笔记   课程   Git   慕课网

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!