Git从入门到精通
2023-06-30 13:48:49 0 举报
AI智能生成
登录查看完整内容
Git从入门到精通
作者其他创作
大纲/内容
Git 是一个免费的、开源的分布式版本控制系统,可以快速高效地处理从小型到大型的各种项目。Git 易于学习,占地面积小,性能极快。 它具有廉价的本地库,方便的暂存区域和多个工作流分支等特性。其性能优于 Subversion、CVS、Perforce 和 ClearCase 等版本控制工具。
概述
版本控制是一种记录文件内容变化,以便将来查阅特定版本修订情况的系统。版本控制其实最重要的是可以记录文件修改历史记录,从而让用户能够查看历史版本,方便版本切换。
1.何为版本控制
个人开发过渡到团队协作。
2.为什么需要版本控制
集中式版本控制工具: CVS、SVN(Subversion)、VSS分布式版本控制工具: Git、Mercurial、Bazaar、Darcs
3.版本控制工具
4.Git的工作机制
代码托管中心是基于网络服务器的远程代码仓库,一般我们简单称为远程库。局域网:GitLab;互联网:GitHub(外网),Gitee 码云(国内网站)
5.Git 和代码托管中心
Git 概述
https://git-scm.com/
官网地址
根据自己电脑系统下载对应的安装包,安装路径最好不要有中文和空格。
温馨提示
Git 安装
常用命令
基本语法git config --global user.name 用户名git config --global user.email 邮箱
签名的作用是区分不同操作者身份。用户的签名信息在每一个版本的提交信息中能够看到,以此确认本次提交是谁做的。Git 首次安装必须设置一下用户签名,否则无法提交代码。
1.设置用户签名
基本语法git init
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720$ git initInitialized empty Git repository in D:/Git-Space/SH0720/.git/Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ ll -atotal 4drwxr-xr-x 1 Layne 197609 0 11 月 25 14:07 ./drwxr-xr-x 1 Layne 197609 0 11 月 25 14:07 ../drwxr-xr-x 1 Layne 197609 0 11 月 25 14:07 .git/ (.git 初始化的效果,生成 git)
2.初始化本地库
基本语法git status
案例实操 首次查看(工作区没有任何文件)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git statusOn branch masterNo commits yetnothing to commit (create/copy files and use \"git add\" to track)
新增文件(hello.txt)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ vim hello.txthello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!
再次查看(检测到未追踪的文件)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git statusOn branch masterNo commits yetUntracked files: (use \"git add <file>...\" to include in what will be committed) hello.txtnothing added to commit but untracked files present (use \"git add\" to track)
3.查看本地库状态
将工作区的文件添加到暂存区基本语法git add 文件名
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git add hello.txtwarning: LF will be replaced by CRLF in hello.txt.The file will have its original line endings in your working directory.
查看状态(检测到暂存区有新文件)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git statusOn branch masterNo commits yetChanges to be committed: (use \"git rm --cached <file>...\" to unstage) new file: hello.txt
4.添加暂存区
将暂存区的文件提交到本地库基本语法git commit -m \"日志信息\" 文件名
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git commit -m \"my first commit\
查看状态(没有文件需要提交)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ font color=\"#e74f4c\
5.提交本地库
Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ vim hello.txthello git! hello atguigu! 2222222222222hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!
查看状态(检测到工作区有文件被修改)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git statusOn branch masterChanges not staged for commit: (use \"git add <file>...\" to update what will be committed) (use \"git checkout -- <file>...\" to discard changes in working directory) modified: hello.txtno changes added to commit (use \"git add\" and/or \"git commit -a\")
将修改的文件再次添加暂存区Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git add hello.txtwarning: LF will be replaced by CRLF in hello.txt.The file will have its original line endings in your working directory.
查看状态(工作区的修改添加到了暂存区)Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git statusOn branch masterChanges to be committed: (use \"git reset HEAD <file>...\" to unstage) modified: hello.txt
6.修改文件
查看历史版本基本语法git reflog 查看版本信息git log 查看版本详细信息
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git reflog087a1a7 (HEAD -> master) HEAD@{0}: commit: my third commitca8ded6 HEAD@{1}: commit: my second commit86366fa HEAD@{2}: commit (initial): my first commit
版本穿梭基本语法git reset --hard 版本号
案例实操--首先查看当前的历史记录,可以看到当前是在 087a1a7 这个版本Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git reflog087a1a7 (HEAD -> master) HEAD@{0}: commit: my third commitca8ded6 HEAD@{1}: commit: my second commit86366fa HEAD@{2}: commit (initial): my first commit--切换到 86366fa 版本,也就是我们第一次提交的版本Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git reset --hard 86366faHEAD is now at 86366fa my first commit--切换完毕之后再查看历史记录,当前成功切换到了 86366fa 版本Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git reflog86366fa (HEAD -> master) HEAD@{0}: reset: moving to 86366fa087a1a7 HEAD@{1}: commit: my third commitca8ded6 HEAD@{2}: commit: my second commit86366fa (HEAD -> master) HEAD@{3}: commit (initial): my first commit--然后查看文件 hello.txt,发现文件内容已经变化$ cat hello.txthello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!
Git 切换版本,底层其实是移动的 HEAD 指针
7.历史版本
Git 常用命令
在版本控制过程中,同时推进多个任务,为每个任务,我们就可以创建每个任务的单独分支。使用分支意味着程序员可以把自己的工作从开发主线上分离开来,开发自己分支的时候,不会影响主线分支的运行。对于初学者而言,分支可以简单理解为副本,一个分支就是一个单独的副本。(分支底层其实也是指针的引用)
1.什么是分支
同时并行推进多个功能开发,提高开发效率。各个分支在开发过程中,如果某一个分支开发失败,不会对其他分支有任何影响。失败的分支删除重新开始即可。
git branch 分支名 #创建分支git branch -v #查看分支git checkout 分支名 #切换分支git merge 分支名 #把指定的分支合并到当前分支上
分支的操作
2.分支的好处
基本语法git branch -v
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git branch -v* master 087a1a7 my third commit (*代表当前所在的分区)
1.查看分支
基本语法git branch 分支名
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git branch hot-fixLayne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git branch -vhot-fix 087a1a7 my third commit (刚创建的新的分支,并将主分支 master的内容复制了一份)* master 087a1a7 my third commit
2.创建分支
--在 maste 分支上做修改Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ vim hello.txt--添加暂存区Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git add hello.txt--提交本地库Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git commit -m \"my forth commit\
3.修改分支
基本语法git checkout 分支名
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git checkout hot-fixSwitched to branch 'hot-fix'--发现当先分支已由 master 改为 hot-fixLayne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (hot-fix)$--查看 hot-fix 分支上的文件内容发现与 master 分支上的内容不同Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (hot-fix)$ cat hello.txthello git! hello atguigu! 2222222222222hello git! hello atguigu! 3333333333333hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!--在 hot-fix 分支上做修改Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (hot-fix)$ cat hello.txthello git! hello atguigu! 2222222222222hello git! hello atguigu! 3333333333333hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu! hot-fix test--添加暂存区Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (hot-fix)$ git add hello.txt--提交本地库Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (hot-fix)$ git commit -m \"hot-fix commit\" hello.txt
4.切换分支
基本语法git merge 分支名
案例实操 在 master 分支上合并 hot-fix 分支 演示分支合并冲突Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git merge hot-fixAuto-merging hello.txtCONFLICT (content): Merge conflict in hello.txtAutomatic merge failed; fix conflicts and then commit the result.
$ cat hello.txthello git! hello atguigu! 2222222222222hello git! hello atguigu! 3333333333333hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!<<<<<<< HEADhello git! hello atguigu! master testhello git! hello atguigu!=======hello git! hello atguigu!hello git! hello atguigu! hot-fix test>>>>>>> hot-fix
解决冲突编辑有冲突的文件,删除特殊符号,决定要使用的内容特殊符号:<<<<<<< HEAD 当前分支的代码 ======= 合并过来的代码 >>>>>>> hot-fix
hello git! hello atguigu! 2222222222222hello git! hello atguigu! 3333333333333hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu!hello git! hello atguigu! master testhello git! hello atguigu! hot-fix test
Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master|MERGING)$ git add hello.txt
Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master|MERGING)$ git commit -m \"merge hot-fix\" #(注意:此时使用 git commit 命令时不能带文件名[master 69ff88d] merge hot-fix--发现后面 MERGING 消失,变为正常Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)
5.合并分支
3.分支的操作
Git 分支操作
团队内协作
跨团队协作
Git 团队协作机制
https://github.com/
GitHub地址
登录自己的账号,点击 右上角 + 号,选择 new repository按钮,输入相关仓库名即可。
1.创建远程仓库
2.远程仓库操作
基本语法git remote -v 查看当前所有远程地址别名git remote add 别名 远程地址
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git remote -vLayne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git remote add ori https://github.com/atguiguyueyue/git-shTest.gitLayne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$ git remote -vori https://github.com/atguiguyueyue/git-shTest.git (fetch)ori https://github.com/atguiguyueyue/git-shTest.git (push)
3.创建远程仓库别名
基本语法git push 别名 分支
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/SH0720 (master)$font color=\"#e74f4c\
4.推送本地分支到远程仓库
基本语法git clone 远程地址
案例实操Layne@LAPTOP-Layne MINGW64 /d/Git-Space/pro-linghuchong$ font color=\"#e74f4c\
5.克隆远程仓库到本地
选择邀请合作者。(在仓库设置里操作)
填入想要合作的人(username or fullname or email)
复制网址发送给你目标合作者
目标合作者接收到网址,用浏览器打开它,点击接受邀请
接受邀请成功之后,可以在目标合作者Github账号上看到将来共同开发远程仓库
目标合作者可以修改内容并 push 到远程仓库
6.邀请队员加入团队
基本语法git pull 远程库地址别名 远程分支名
7.拉取远程库内容
找到对应的项目,点击项目右上角的 fork
然后进行内容的修改,提交
进行Pull request 请求进行代码合并
项目所有者确认代码没问题则进行Merge pull reque 合并代码
我们可以看到远程仓库中还有一个 SSH 的地址,因此我们也可以使用 SSH 进行访问
先到用户的主页目录,删除.ssh文件夹(如果没有.ssh文件夹,忽略此步)abc@DESKTOP-R85C9HV MINGW64 ~$ cd ~abc@DESKTOP-R85C9HV MINGW64 ~$ pwd/c/Users/abcabc@DESKTOP-R85C9HV MINGW64 ~$ ls -a .ssh./ ../ id_rsa id_rsa.pubabc@DESKTOP-R85C9HV MINGW64 ~$ rm -rf .sshabc@DESKTOP-R85C9HV MINGW64 ~$ ls -a .sshls: cannot access '.ssh': No such file or directory
运行命令ssh-keygen生成.ssh目录abc@DESKTOP-R85C9HV MINGW64 ~/Desktop/HelloGit-clone/HelloGit (master)$ ssh-keygen -t rsa -C abc@123.comGenerating public/private rsa key pair.Enter file in which to save the key (/c/Users/abc/.ssh/id_rsa):Created directory '/c/Users/abc/.ssh'.Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /c/Users/abc/.ssh/id_rsaYour public key has been saved in /c/Users/abc/.ssh/id_rsa.pubThe key fingerprint is:SHA256:aeNMB/hP2yiH/Dka2jK9BJciSgA8yKKLlKXX8oei7J0 jallenkwong@163.comThe key's randomart image is:+---[RSA 3072]----+|= ||++ . . ||+ = . . . ||.= o . . + ||o.o + + S o ||o. o + @ * + ||. o . ..O = . || o. . o+.=.. ||.. E .o+oo. |+----[SHA256]-----+abc@DESKTOP-R85C9HV MINGW64 ~$ ls -a .ssh./ ../ id_rsa id_rsa.pub# 生成公钥abc@DESKTOP-R85C9HV MINGW64 ~$ cat .ssh/id_rsa.pubssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQChXy8I20br9nu4GCNeZSDkozfHvlRFpXiImYnVlHVvyvFgjct1/zMeJgot1J6+yArSJbA4TMlS9nG8owCE6C9yqhPceDlKtQbARKS2pW7IyP5OhIbcqVmWmvvd+IMmsWrWgK9S6jqp0xSqv3Z3mlcHWOAK18oOe6wF6b3SyGgCP/EcwwUGX4NG7jukhK+In9joSuAxchEg/Ba2/LVjqtfBn3hXZx/SEt+rJ0UVPIT/eEe32HflrzokNcO7l0IgyLntv5QEAsSC2hiGxrM6vF5tQpb12MVZnt1/01ytP0ruQn2TVTI96vsOAa3Cj98dAH2Z0JdqZUSVBw+o3AqXP5oeF1JWkDHZzHQjLgu741wnUZn+vVXFBu1xQyApbvH7y7cNbq8PaxU+SyZbVXbq3RwTywJsyFQvsIOM5l0tG7jUD0QAd6dP3rcNODjFTaafJaBsR9aMwvKQd/d7H+BdwFPYOFp8HB2JAzhRpvlS4Av9MCIe0474wZ0T2QOJmcs7mns= abc@123.com
然后,将生成的公钥添加至Github账号SSH设置登录github -- 点击头像 -- Settings -- SSH and GPG keys -- New SSH key
SSH免密登录
GitHub 操作
与项目的实际功能无关,不参与服务器上部署运行。把它们忽略掉能够屏蔽 IDE 工具之间的差异。
1.为什么要忽略
在.gitconfig 文件中引用忽略配置文件(此文件在 Windows 的家目录中)[user]name = Layneemail = Layne@atguigu.com[core]excludesfile = C:/Users/asus/git.ignore注意:这里要使用“正斜线(/)”,不要使用“反斜线(\\)”
方式一创建忽略规则文件 xxxx.ignore(前缀名随便起,建议是 git.ignore)这个文件的存放位置原则上在哪里都可以,为了便于让~/.gitconfig 文件引用,建议也放在用户家目录下
方式二idea 中安装ignore插件进行文件忽略配置
配置 Git 程序
2.怎么忽略
配置 Git 忽略文件
右键点击HelloGit,Git -> Repository -> Branches,或者点击IDEA的右下角,如图红圈所示部位
创建分支
跟创建分支步骤相似,如点击IDEA的右下角(它显示项目正处在那条分支),如图红圈所示部位,选择你想要切换的分支,然后checkout
或者在log窗口,右键点击分支,选择checkout
切换分支
先在hot-fix分支修改HelloGit类,并将其提交
然后切换到master分支,右下角的hot-fix会变为master
然后,点击IDEA 窗口的右下角的master,将 hot-fix 分支合并到当前 master 分支。选择hot-fix->Merge into Current
如果代码没有冲突, 分支直接合并成功,分支合并成功以后,代码自动提交,无需手动提交本地库。
合并分支(正常合并)
分别在master,hot-fix分支修改HelloGit类同一行,并提交,故意制作冲突
切换到master分支,将hot-fix的合并到master分支
冲突产生,需要人工解决
手动合并完代码以后,点击右下角的 Apply 按钮
合并分支(冲突合并)
IDEA 集成Git
如果出现 401 等情况连接不上的,是因为网络原因,可以使用以下方式连接
然后去 GitHub 账户上设置 token
设置 GitHub 账号
分享工程到 GitHub
一般情况 不需要做这个操作!!!
右键点击项目,可以将当前分支的内容 push 到 GitHub 的远程仓库中
push 推送本地库到远程库
右键点击项目,可以将远程仓库的内容 pull 到本地仓库
pull 拉取远程库到本地库
clone 克隆远程库到本地
IDEA 集成GitHub
https://gitee.com/
这个太简单了,界面都是中文和github基本一样不多赘述
码云创建远程库
在插件中 搜索 gitee 安装即可,记得安装成功后重启 IDEA
重启成功后 在setting 中 选择 version control就可以看见 Gitee 了
接着就是添加 对应的账号信息
IDEA 集成码云
Idea 连接码云和连接 GitHub 几乎一样,首先在 Idea 里面创建一个工程,初始化 git 工程,然后将代码添加到暂存区,提交到本地库,这些步骤上面已经讲过,此处不再赘述
给远程库链接定义个 name,然后再 URL 里面填入码云远程库的 HTTPS 链接即可
然后选择定义好的远程链接,点击 Push 即可
只要码云远程库链接定义好以后,对码云远程库进行 pull 和 clone 的操作和 Github 一致,不再重复赘述
IDEA 连接码云(本地项目推送到码云)
码云提供了直接复制 GitHub 项目的功能,方便我们做项目的迁移和下载
码云复制 GitHub 项目
国内托管中心-码云
GitLab 是由 GitLabInc.开发,使用 MIT 许可证的基于网络的 Git 仓库管理工具,且具有wiki 和 issue 跟踪功能。使用 Git 作为代码管理工具,并在此基础上搭建起来的 web 服务。GitLab 由乌克兰程序员 DmitriyZaporozhets 和 ValerySizov 开发,它使用 Ruby 语言写成。后来,一些部分用 Go 语言重写。截止 2018 年 5 月,该公司约有 290 名团队成员,以及 2000 多名开源贡献者。GitLab 被 IBM,Sony,JülichResearchCenter,NASA,Alibaba,Invincea,O’ReillyMedia,Leibniz-Rechenzentrum(LRZ),CERN,SpaceX 等组织使用。
简介
https://about.gitlab.com/
准备一个系统为 CentOS7 以上版本的服务器,要求内存 4G,磁盘 50G。关闭防火墙,并且配置好主机名和 IP,保证服务器可以上网。此教程使用虚拟机:主机名:gitlab-server IP 地址:192.168.6.200
服务器准备
下载地址https://packages.gitlab.com/gitlab/gitlabce/packages/el/7/gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm
安装包准备
sudo rpm -ivh /opt/module/gitlab-ce-13.10.2-ce.0.el7.x86_64.rpmsudo yum install -y curl policycoreutils-python openssh-server croniesudo lokkit -s http -s sshsudo yum install -y postfixsudo service postfix startsudo chkconfig postfix oncurl https://packages.gitlab.com/install/repositories/gitlab/gitlabce/script.rpm.sh | sudo bashsudo EXTERNAL_URL=\"http://gitlab.example.com\" yum -y install gitlabce
[root@gitlab-server module]# vim gitlab-install.sh
chmod +x gitlab-install.sh
编写安装脚本
gitlab-ctl reconfigure
初始化 GitLab 服务
gitlab-ctl start
启动 GitLab 服务
192.168.0.200
浏览器器访问 GitLab
登录修改密码
GitLab 安装
GitLab 创建远程库
安装 GitLab 插件
设置 GitLab 插件
配置 GitLab 服务器链接
首次向连接 gitlab,需要登录帐号和密码
IDEA 集成 GitLab
自建代码托管平台-GitLab
tips:在公司团队协作记得养成一个良好的习惯,push之前记得先pull ,很大程度可以避免不必要的代码冲突!
笔记来源:尚硅谷Git入门到精通全套教程(涵盖GitHub\\Gitee码云\\GitLab)https://www.bilibili.com/video/BV1vy4y1s7k6?p=1&vd_source=857c09f64774965075bb71876d9dae79
Git从入门到精通
0 条评论
回复 删除
下一页