Files
codefever/doc/zh-cn/git/create_branch.md
Carney Wu d3de96487f initial version (#1)
* fix(Useless Code): remove useless code

* feat(Deploy Scripts): add deploy scripts

* fix(Delopy Script): change settings

* fix(Deploy Script): fix ssh-keygen script

* fix(Deploy Script): change env file path

* feat(Deploy Script): add db migration

* fix(Deploy script): change script

* feat(Deploy Script): add sql file to create database

* fix(Deploy Script): add composer support

* fix(Deploy Script): add composer

* fix(Service Script): add http gateway

* fix(Deploy Script): add git path

* fix(Deploy Script): fix setting bugs

* fix(Init Script): get user from config

* fix(Service): adjust run users

* feat(Doc): add doc

* fix(Doc): change docs

* fix(Deploy script): change owner of storage path

* feat: codefever-community documentation system

* fix(Doc): doc details page style

* feat: fix page navigation

* fix(SQL File): fix db file fit MySQL 5.7

* fix(FileTree): empty repository display

* fix: fix helper navigation

* docs(zh-cn essential part):

* fix(Doc Style): change markdown.css

* docs(contribution doc):

* fix: unified page style

* docs(Readme): add readme

* build(Build):

Co-authored-by: cubic <carneywu@pgyer.com>
Co-authored-by: pololi <pololi@pgyer.com>
Co-authored-by: yangchen <chenyang@pgyer.com>
2022-01-19 17:21:59 +08:00

40 lines
1.0 KiB
Markdown

# 创建第一个分支
在 CodeFever 新建的仓库没有任何内容,需要在本地创建仓库的第一个分支,并推送到远程仓库。
1. 克隆远程仓库到本地(这里使用 `SSH` 的方式克隆,克隆前需要在 `SSH Key` 设置中添加本地 `SSH` 信息),并切换到仓库根目录,例如:
```shell
git clone ssh://git@your.domain:group_name/project_name.git
cd project_name
```
克隆完成后,工作目录已经切换到默认的 `master` 分支,也可以创建其他的分支,例如:
```shell
git checkout -b branch_name
```
2. 添加内容,创建一次提交,例如:
```shell
echo 'init' > readme.md
git add readme.md
git commit -m 'init commit'
```
3. 推送到远程仓库,例如:
```shell
git push origin branch_name
```
参照:
[git clone](git_command_reference.md#git-clone)
[git checkout](git_command_reference.md#git-checkout)
[git add](git_command_reference.md#git-add)
[git commit](git_command_reference.md#git-commit)
[git push](git_command_reference.md#git-push)