如何设置这个git工作流程?

时间:2010-10-09 06:59:41

标签: git workflow git-rebase git-workflow

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

  1. 克隆一个开源项目,我只能读取他们的git repo
  2. 对项目进行更改并将这些更改保存到我的私有github repo中 - 让我们称之为'development'
  3. 一旦dev更改稳定,请将其移至'staging'
  4. 测试'staging'后,将更改移至'production'
  5. 将远程开源项目称为每周一次,因为它总是在变化,然后再次开始整个过程​​。
  6. 由于

1 个答案:

答案 0 :(得分: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