1

我希望能够设置以下 git 工作流程,但是对于要使用哪些正确命令(rebase、remote 等)感到困惑?

  1. 克隆一个开源项目,我对其 git 存储库只有只读访问权限
  2. 对项目进行更改并将这些更改保存到我的私人 github 存储库 - 让我们称之为“开发”
  3. 一旦开发更改稳定,将它们移至“暂存”
  4. 测试“暂存”后,将更改移至“生产”
  5. 每周同步远程开源项目,因为它总是在变化,然后重新开始整个过程​​。

谢谢

4

1 回答 1

1
# clone, create and change to branch development
git clone git://the/open/source/project.git
git checkout -b development

# make changes and commit
git add ...
git commit -m '...'

# several commits later, create a branch named staging and change to it
git checkout -b staging

# after testing, create a branch named production and change to it
git checkout -b production

# syncing ( assuming the remote to be named origin and the branch is named master )
git checkout master
git fetch origin master
git merge origin/master

# repeat the process
于 2010-10-09T07:11:47.477 回答