git使用教程

git使用教程

1.在github等上面建立自己的仓库,如图:
git使用教程
保留下来
https://repo.zihang.xin/wuchao/personalBlog.git
2.在本机上安装git
git使用教程
3.创建本地仓库
git使用教程
4.将本地仓库添加git
1)进入目录,右键,找到git bash,如图:
git使用教程

2)打开git bash,将当前目录添加git 功能,在控制台如图输入     git init ,如图:

git使用教程
此时,当前目录会自动创建一个文件
git使用教程
3)在本地仓库中新建一个文件,并将文件添加到git中 命令:git add xxx.xx
git使用教程
4)给远程仓库中提交 命令 git commmit
git使用教程
5)链接到远程仓库 命令 git remote add xxx yyyy

xxx : 远程仓库的名字
yyy: 远程仓库的链接地址
如图:
git使用教程
6)将本地仓库的数据push 到远程仓库 命令 git push -u xxx master
xxx: 远程仓库的名字

7) 常用命令:
输入用户名: git config --global username xxxx
输入密码: git config --global emal yyy
没有配置用户名 密码 可以使用此条命令:
git config --system --unset credential.helper