git的新手使用教程

在git中,使用git.commit命令时,这个Please tell me who yoy are 解决办法
![]在这里插入图片描述
出现这个的原因就是您没登陆,您需要登录您的用户名和邮箱

> git config --global user.name  "Your name"
> git config --global user.email  "email@example.com"

** 1) 个人使用**

远程仓库 -> github
本地仓库 -> 文件夹

    **1. 先有远程仓库,再克隆**
        1、在github/gitee上新建仓库
        2、在本地新建文件夹
        3、将远程仓库的代码克隆到本地文件夹**加粗样式**
            > git clone https://xxx.git
        4、编写代码...
        5、将代码提交到本地仓库
            > git add *
        6、编写提交信息
            > git commit -m "[姓名]修改了/提交了"
        7、将代码提交到远程仓库
            > git push origin master


  **2. 先有本地仓库,再有远程仓库**
        1、在本地新建文件夹
        2、编写代码
        3、新建远程仓库
        4、将本地的文件夹初始化为本地仓库
            > git init
        5、将代码提交到本地仓库
            > git add *
        6、编写提交信息
            > git commit -m "message"
        7、绑定本地仓库与远程仓库
            > git remote add origin https://xxx.git
        8、将代码提交到远程仓库
            > git push origin master

2) 团队项目

	1. 新建远程仓库(组长)
    2. 邀请合作者
        管理 -> 仓库成员管理 -> 邀请用户  
    3. 被邀请者在邮箱进行同意
    4. 进行多人开发
    	> git clone 地址
    	团队编写代码
    	> git add *
    	> git commit -m 'message'
    *****> git pull origin master (更新远程仓库代码到本地)
    	> git push origin master (提交本地仓库到远程)

3)版本回退

    > git status 查看状态
    > git log 查看提交日志
    > git reflog 查看所有提交日志
    > git reset --hard commitID 回退到某次提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值