Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
afc72d34
未验证
提交
afc72d34
编辑于
5 months ago
作者:
Brendan Lynch
提交者:
GitLab
5 months ago
浏览文件
操作
下载
补丁
差异文件
Update Getting started parent page
上级
1e5f7374
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
doc/topics/git/get_started.md
+31
-6
31 个添加, 6 个删除
doc/topics/git/get_started.md
有
31 个添加
和
6 个删除
doc/topics/git/get_started.md
+
31
−
6
浏览文件 @
afc72d34
...
@@ -21,7 +21,7 @@ Learning Git is part of a larger workflow:
...
@@ -21,7 +21,7 @@ Learning Git is part of a larger workflow:
A Git repository is essentially a directory that contains all the files,
A Git repository is essentially a directory that contains all the files,
folders, and version history of a project.
folders, and version history of a project.
It serves as a central hub
where you can
store, manage, and share your code
or content
.
It serves as a central hub
to
store, manage, and share your code.
When you initialize a Git repository or clone an existing one, Git
When you initialize a Git repository or clone an existing one, Git
creates a hidden directory called
`.git`
in the project directory.
creates a hidden directory called
`.git`
in the project directory.
...
@@ -83,7 +83,15 @@ For more information, see:
...
@@ -83,7 +83,15 @@ For more information, see:
-
[
Tutorial: Make your first Git commit
](
../../tutorials/make_first_git_commit/index.md
)
-
[
Tutorial: Make your first Git commit
](
../../tutorials/make_first_git_commit/index.md
)
-
[
Forks
](
../../user/project/repository/forking_workflow.md
)
-
[
Forks
](
../../user/project/repository/forking_workflow.md
)
## Step 4: Familiarize yourself with Git commands
## Step 4: Install Git
Before you start using Git commands and contributing to GitLab projects, you must download
and install the Git client on your computer. The installation process varies depending on
your operating system.
For information on how to install Git, see
[
Install Git
](
how_to_install_git/index.md
)
.
## Step 5: Familiarize yourself with Git commands
To work with Git from the command line, you need to use various Git commands.
To work with Git from the command line, you need to use various Git commands.
Some of the most commonly used commands include:
Some of the most commonly used commands include:
...
@@ -96,13 +104,30 @@ Some of the most commonly used commands include:
...
@@ -96,13 +104,30 @@ Some of the most commonly used commands include:
-
`git push`
: Push local commits to the remote repository
-
`git push`
: Push local commits to the remote repository
-
`git pull`
: Fetch changes from the remote repository and merge them into your local branch
-
`git pull`
: Fetch changes from the remote repository and merge them into your local branch
For more information, see:
For more comprehensive information and detailed explanations,
see
[
Command Git commands
](
commands.md
)
guide.
<!--- Use this section when the
[
Generate an SSH key pair
](
../user/ssh.md
)
page is added to the navigation
-
[
Command line Git
](
commands.md
)
### Use SSH with Git
## Step 5: Practice using Git
When you work with remote repositories, you should use SSH for secure communication.
GitLab uses the SSH protocol to securely communicate with Git.
When you use SSH keys to authenticate to the GitLab remote server,
you don't need to supply your username and password each time.
To learn how to generate and add SSH keys to your GitLab account,
see
[
Generate an SSH key pair
](
../user/ssh.md
)
.
-->
## Step 6: Practice using Git
The best way to learn Git is by using it in practice. Create a test project,
The best way to learn Git is by using it in practice. Create a test project,
experiment with different commands, and try out various workflows.
experiment with different commands, and try out various workflows.
GitLab provides a web-based interface for many Git operations,
GitLab provides a web-based interface for many Git operations,
but it's also useful to understand how to use Git from the command line.
but it is also used to understand how to use Git from the command line.
For a hands-on approach to learning Git commands, see the
[
Tutorial: Make your first Git commit
](
../../tutorials/make_first_git_commit/index.md
)
.
For other helpful resources, see
[
Tutorials: Learn Git
](
../../tutorials/learn_git.md
)
.
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录