eugene
eugene

Reputation: 41665

Git, so when should we use rebase?

Only when there 'll be no further commit to the branch?

Which implies: Share branch (published branch) is not a good fit for rebase.

Are there other restrictions on when to use rebase?

Upvotes: 1

Views: 131

Answers (1)

s5v
s5v

Reputation: 505

the only problem with using rebase, is that it changes the history. so as long as you are not on the master branch, where it is advisable to retain history, you can use rebase all the time. maybe use git rebase --committer-date-is-author-date to keep the committers date

If you've already screwed up the commit dates and want to reset them to their corresponding author dates, you can run:

git filter-branch --env-filter 'GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE; export GIT_COMMITTER_DATE'

Upvotes: 1

Related Questions