мерзавец svn рабочий процесс - ответвления функции и слияние

Закрытие является функцией, которая может сослаться на состояние в другой функции. Например, в Python, это использует "внутреннее" закрытие:

def outer (a):
    b = "variable in outer()"
    def inner (c):
        print a, b, c
    return inner

# Now the return value from outer() can be saved for later
func = outer ("test")
func (1) # prints "test variable in outer() 1
26
задан Pradeep 15 July 2009 в 08:11
поделиться

3 ответа

SVN cannot handle non-linear history (it simply has no notation of it). So what you want to do is a rebase instead of a merge as it preserves linear history with SVN (this is indicated in on the git-svn man page here.

To elaborate, linear histories are trivial. They go in a straight line (A to B to C to D). Whereas non-linear histories can go from (A to B to C, B to D then C + D to E--in other words, they off sprout into branches).

Rebasing will give you a linear history. Remember that rebases should be done from your private local-only branches. For instances, if you have 2 branches: master and experimental. You would checkout experimental and do 'git rebase master' preferably with the -i flag. Doing it the other way around may result in undesirable side effects.

It is then you checkout master and merge in the changes from the experimental branch. Your history should remain linear.

26
ответ дан 28 November 2019 в 07:47
поделиться

You should look at this merge option:

git checkout master
git merge --squash featureZ

It will squash all commits on the branch into a single commit on the master branch. You will get an opportunity to edit the log message, which is initialized with a summary of what was done on the branch.

It has the disadvantage that the individual commits on the feature branch are not recorded. Furthermore, you should only do this once, and not do any more work on the branch, because it is not registered as a proper merge, and any subsequent merge might give undesired results.

4
ответ дан 28 November 2019 в 07:47
поделиться

Ответ поддельный-код-обезьяна-рашид правильный. Это не столько ответ, сколько упрощение.

Вы можете svn rebase / dcommit из любой ветки git. Единственное использование master - это если у вас есть другие локальные изменения, которые необходимо объединить с изменениями из featureZ .

git branch featureZ
git checkout featureZ
#bunch of changes
git commit
git svn rebase
# solve any conflicts
git svn dcommit

Если вы хотите сохранить чистый мастер, вы можете либо git svn rebase it или git merge featuresZ

2
ответ дан 28 November 2019 в 07:47
поделиться
Другие вопросы по тегам:

Похожие вопросы: