git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rebase destroys branches
@ 2013-03-04 23:06 Gene Thomas [DATACOM]
  2013-03-04 23:43 ` Philip Oakley
  0 siblings, 1 reply; 5+ messages in thread
From: Gene Thomas [DATACOM] @ 2013-03-04 23:06 UTC (permalink / raw)
  To: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

Hello,
          I am evaluating git for use in a company. Please correct if I am wrong. I am concerned that an inexperienced developer could mistakenly rebase branches, destroying the original branch. Attached is a script (Windoze) that shows the 'topic' branch being moved!, after the rebase we are unable to see the original branch, read it's history or find it's commit points.

Surely no operation should remove anything from the repository. Operations like this irreversibly break the repository . When rebasing the original branch must be retained.

Yours faithfully,


Gene Thomas.


[-- Attachment #2: git-test.bat --]
[-- Type: application/octet-stream, Size: 1196 bytes --]


rem https://www.kernel.org/pub/software/scm/git/docs/git-rebase.html

rem (c) 2013 Gene Thomas
rem Datacom
rem Gene.Thomas@datacom.co.nz

if exist "git-test" rmdir /q /s git-test
mkdir git-test
cd git-test
git init

rem ==========================

echo d > d.txt
git add d.txt
git tag d
git commit -a -m d

echo e > e.txt
git add e.txt
git tag e
git commit -a -m e

git branch topic
git checkout topic

echo a > a.txt
git add a.txt
git tag a
git commit -m a

echo b > b.txt
git add b.txt
git tag b
git tag v2.0
git commit -a -m b

echo c > c.txt
git add c.txt
git tag c
git commit -a -m c

git log

rem ==========================

git checkout master

echo f > f.txt
git add f.txt
git tag f
git commit -a -m f

echo g > g.txt
git add g.txt
git tag g
git commit -a -m g

rem ==========================

git checkout topic
git rebase master

git log

rem ==========================

git checkout v2.0
git branch
rem we are on the "(no branch)" psuedo branch

rem origional 'topic' branch is lost
rem commits are still in the repositry
rem but can only be referenced by hash or tag
rem a mistake would destroy the history

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-05 22:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04 23:06 rebase destroys branches Gene Thomas [DATACOM]
2013-03-04 23:43 ` Philip Oakley
2013-03-05  1:05   ` Gene Thomas [DATACOM]
2013-03-05  2:21     ` Theodore Ts'o
2013-03-05 22:04     ` Philip Oakley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).