git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git reset respect remote repo (make git idiot proof)
@ 2012-10-03 14:49 Geoffrey De Smet
  2012-10-03 14:59 ` Ramkumar Ramachandra
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Geoffrey De Smet @ 2012-10-03 14:49 UTC (permalink / raw)
  To: git

Suppose this case:

git clone .../blessedRepo.git
// do changes
git commit -m"bad1"
// do changes
git commit -m"bad2"
git reset --hard HEAD^4 // Why does it let me do this?

// I just "broke" my local repository, because if I continue

// do changes
git commit -m"good1"
git push origin master // fails because the history disrespects the 
remote repo's history

The following commands are ok to do (because I have 2 unpushed commits):
  git reset --hard^1
  git reset --hard^2
but these are not and should be prevented (unless forced):
  git reset --hard^3
  git reset --hard^4


Is there any way to make git idiot proof by enabling that the local repo 
should always respect the history of the remote repo (unless forced)?
Is there any way to make this a default for anyone who clones our 
blessed repo?
No one that clones our blessed repo wants to come into the situation 
above. And if they do, they can always force it.

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

end of thread, other threads:[~2012-10-05  6:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-03 14:49 git reset respect remote repo (make git idiot proof) Geoffrey De Smet
2012-10-03 14:59 ` Ramkumar Ramachandra
2012-10-03 15:12   ` Geoffrey De Smet
2012-10-03 16:40 ` Phil Hord
2012-10-04  8:59   ` Geoffrey De Smet
2012-10-05  3:11     ` Junio C Hamano
2012-10-05  5:35     ` Dirk Heinrichs
2012-10-03 16:52 ` Andreas Schwab
2012-10-04  8:56   ` Geoffrey De Smet

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).