Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
05ca1096
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
05ca1096
编写于
3月 22, 2016
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge Git basics into Start using Git
[ci skip]
上级
1030ebb8
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
63 addition
and
59 deletion
+63
-59
doc/gitlab-basics/README.md
doc/gitlab-basics/README.md
+0
-1
doc/gitlab-basics/basic-git-commands.md
doc/gitlab-basics/basic-git-commands.md
+1
-57
doc/gitlab-basics/start-using-git.md
doc/gitlab-basics/start-using-git.md
+62
-1
未找到文件。
doc/gitlab-basics/README.md
浏览文件 @
05ca1096
...
...
@@ -5,7 +5,6 @@ Step-by-step guides on the basics of working with Git and GitLab.
-
[
Start using Git on the command line
](
start-using-git.md
)
-
[
Create and add your SSH Keys
](
create-your-ssh-keys.md
)
-
[
Command Line basic commands
](
command-line-commands.md
)
-
[
Basic Git commands
](
basic-git-commands.md
)
-
[
Create a project
](
create-project.md
)
-
[
Create a group
](
create-group.md
)
-
[
Create a branch
](
create-branch.md
)
...
...
doc/gitlab-basics/basic-git-commands.md
浏览文件 @
05ca1096
# Basic Git commands
### Go to the master branch to pull the latest changes from there
```
git checkout master
```
### Download the latest changes in the project
This is for you to work on an up-to-date copy (it is important to do every time you work on a project), while you setup tracking branches.
```
git pull REMOTE NAME-OF-BRANCH -u
```
(REMOTE: origin) (NAME-OF-BRANCH: could be "master" or an existing branch)
### Create a branch
Spaces won't be recognized, so you need to use a hyphen or underscore.
```
git checkout -b NAME-OF-BRANCH
```
### Work on a branch that has already been created
```
git checkout NAME-OF-BRANCH
```
### View the changes you've made
It's important to be aware of what's happening and what's the status of your changes.
```
git status
```
### Add changes to commit
You'll see your changes in red when you type "git status".
```
git add CHANGES IN RED
git commit -m "DESCRIBE THE INTENTION OF THE COMMIT"
```
### Send changes to gitlab.com
```
git push REMOTE NAME-OF-BRANCH
```
### Delete all changes in the Git repository, but leave unstaged things
```
git checkout .
```
### Delete all changes in the Git repository, including untracked files
```
git clean -f
```
### Merge created branch with master branch
You need to be in the created branch.
```
git checkout NAME-OF-BRANCH
git merge master
```
This section is now merged into
[
Start using Git
](
start-using-git.md
)
.
doc/gitlab-basics/start-using-git.md
浏览文件 @
05ca1096
# Start using Git on the command line
If you want to start using a Git and GitLab, make sure that you have created an account on GitLab.
If you want to start using a Git and GitLab, make sure that you have created an
account on GitLab.
## Open a shell
...
...
@@ -59,3 +60,63 @@ To view the information that you entered, type:
```
git config --global --list
```
## Basic Git commands
### Go to the master branch to pull the latest changes from there
```
git checkout master
```
### Download the latest changes in the project
This is for you to work on an up-to-date copy (it is important to do every time you work on a project), while you setup tracking branches.
```
git pull REMOTE NAME-OF-BRANCH -u
```
(REMOTE: origin) (NAME-OF-BRANCH: could be "master" or an existing branch)
### Create a branch
Spaces won't be recognized, so you need to use a hyphen or underscore.
```
git checkout -b NAME-OF-BRANCH
```
### Work on a branch that has already been created
```
git checkout NAME-OF-BRANCH
```
### View the changes you've made
It's important to be aware of what's happening and what's the status of your changes.
```
git status
```
### Add changes to commit
You'll see your changes in red when you type "git status".
```
git add CHANGES IN RED
git commit -m "DESCRIBE THE INTENTION OF THE COMMIT"
```
### Send changes to gitlab.com
```
git push REMOTE NAME-OF-BRANCH
```
### Delete all changes in the Git repository, but leave unstaged things
```
git checkout .
```
### Delete all changes in the Git repository, including untracked files
```
git clean -f
```
### Merge created branch with master branch
You need to be in the created branch.
```
git checkout NAME-OF-BRANCH
git merge master
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录