git的初步学习

git下载的网站(window)

https://www.git-scm.com/download/win

git类似svn的插件下载

https://tortoisegit.org/

git使用的基本的命令本地仓库

1. 设置用户名
git config --global user.name 'sanqianhuanyu'  

2. 设置用户名邮箱
  git config --global user.email '[email protected]'
3.创建文件
  mkdir test
4.初始化git
cd test
git init
5.创建文件
touch a1.php                         # 创建a1.php文件到工作目录
git add a1.php                      # 添加a1.php到暂存区
git commit -m  '第一次提交文件'     # 添加a1.php到仓库
---- 远程仓库

 git远程仓库

https://github.com/sanqianhuanyu/Hello.git
git config --list
//下载
git clone https://github.com/sanqianhuanyu/Hello.git
touch a1.php                         # 创建a1.php文件到工作目录
git add a1.php                      # 添加a1.php到暂存区
git commit -m  '第一次提交文件'     # 添加a1.php到仓库
--
用户名和密码
答案:私有项目,没有权限,输入用户名密码,或者远程地址采用这种类型:

vi .git/config
config中修改
# 将
[remote "origin"]  
    url = https://github.com/用户名/仓库名.git
修改为:
[remote "origin"]
    url = https://用户名:密码@github.com/用户名/仓库名.git

  

猜你喜欢

转载自www.cnblogs.com/liushisaonian/p/9343482.html
今日推荐