5/23 第一天

On brach master:在主分支上
No commits yet:还没有提交

第一次使用需要输入用户名和密码
$ git push origin master
git使用时必须要输入git
push推到远程
origin网址代号
master和origin在一起
!!*****$ git status 查看当前状态(随时都可以用 随时查看状态)
$ git --help 查看git命令(--help在任何环境里都可以用)
$ history 查看历史命令
$ ls 查看当前文件目录
$ git init 仓库化当前目录
.gitignore 一些被忽略的文件的存放的文件夹
$ rm -f 强制删除 rm递归删除 -f强制删除
$ rm -f .giti+tab键 自动补全(.gitignore)
双击tab 出现相关文件
1.提交文件
$ git commit -m

2.把远程仓库的地址存放到origin中

3.提交打包好的文件

文件打包成功


Linux和window系统里的终止符不一样
5/25 第二天
$ rm -rf .git 删除.git文件
$ ls -a 查看文件
5/26 第三天
$ cat .gitignore 显示.gitignore文件内容

# 是注释
*. 任意多的字符
$ git commit -m "初始化"
将文件保存到本地仓库中,-m 表示message
$ git remote add originself https://github.com/wyw1997/userDemo.git
提交地址
$ git remote
确认地址是否提交
originself
已提交的结果显示
$ git push originself master
提交代码
5/30 第四天
$ git add .
提交当前文件夹中的代码
Ctrl+u
删除一整行
$ tig
可以把代码做到按行提交
:q
退出
$ git status
On branch master
nothing to commit, working tree clean
代码全部提交完成
$ git remote
Originself(远程仓库名称)
查看仓库远程名称
$ git push originself master
把代码提交到远程仓库
git status 之前要 ls -a 看一下文件里的东西
.git 仓库
pom.xml 代码的根目录

以下为一次完整的提交过程:

$ git status
查看当前状态,有红色内容说明有未提交/修改的文件

$ git add .
把文件的所有变化提交到暂存区
$ git status
再次查看当前状态,发现刚才红色的内容已经变绿
$ git commit -m “5/30-2”
将暂存区里的改动给提交到本地的版本库,“5/30-2”为对提交信息的描述
$ git remote
查看远程仓库名称
$ git push originself master
将本地仓库里的内容推到远程仓库中
提交过程中出现了提交失败的提示fatal: TaskCanceledException encountered.
下一行中有username for ‘https://github.com’ : 说明需要输入用户名,然后回车。
用户名输入正确后,会弹出窗口输入密码
输入密码,提交成功
5/31 第五天(建立小组仓库)
1.进入组长的github首页
2.新建仓库(小写、小组名,组长操作)
类型为Public
3.Setting --->collaborators(同伴)--->输入密码--->输入组员名字--->add collsborator(组长操作)
4.在本地电脑上新建文件夹--->git bush here
5.$ ls -a
查看当前目录是否为空
6. $ git clone https://github.com/Limeishun/tyrell.git
地址为组长建立的仓库的地址
(git init在本地建一个仓库,此时不用)
7.$ ls -a
查看目录内容,有一个文件夹
8.$ cd tyrell
进入文件夹,此时为小组仓库
(以下均为组长操作)
9.$ touch readme.md
新建文件夹
10. $ vi readme.md
11.按i
Insert(插入内容),此时可以输入任何字符
12.按esc
从插入状态切换到一般模式
13.Shift+zz
保存内容并退出
如果进入异次元空间:Esc--->:q!
14.$ cat readme.md
查看刚才输入内容
15.$ ls -a
$ git status
可以看到一个刚才建的文件

16.$ git add .
17.$ git status
18.$ git commit -m “小组名”
19.$ git status
20.$ git push origin master
(以下为组员操作)
21.$ git status
查看当前状态
22.$ git pull origin master
把组长建的文件从远程仓库拉回来
23.$ cat readme.md
查看文件中的内容,内容为组长刚才输入的内容