From: Jon Forrest <nobozo@gmail.com>
To: git@vger.kernel.org
Subject: What's The Right Way to Do This?
Date: Fri, 23 Sep 2011 04:48:36 +0000 (UTC) [thread overview]
Message-ID: <loom.20110923T064720-366@post.gmane.org> (raw)
I'm just now starting to use git for more than trivial things.
Today I got myself in trouble. Here's what happened:
1) I pulled the master branch from the IT repository from our
main git server.
2) I created a branch from this called "J" and started making changes.
3) Other people pulled master from IT and then pushed changes back.
4) I merged J with my master branch.
5) I tried pushing my master back to origin but this failed with
the usual message saying I first needed to pull from origin.
So, I pulled and then pushed. This worked.
6) On another server where I was going to use my changes I pulled
master from IT.
6) It turned out that my changes were incorrect. So, I tried to revert
using various methods I found by googling "git revert". What happened
was that when I tried to revert back to the commit before the one I
made, the files I had modified *and* the files that apparently were
modified by other people in #3 above were reverted. This wasn't what
I wanted. I only wanted to revert the changes I had made.
With the help of someone more experienced than me we were able to get
things back to normal but this experience left me wondering what I
should have done in the first place. There's a chance I'm going to
have to go through all this again as I try to fix the problem with
my changes.
Any suggestions would be appreciated.
Thanks,
Jon Forrest
next reply other threads:[~2011-09-23 4:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 4:48 Jon Forrest [this message]
2011-09-23 5:08 ` What's The Right Way to Do This? Michael Witten
2011-09-23 6:30 ` Luke Diamand
2011-09-23 13:45 ` Jon Forrest
2011-09-23 6:39 ` Johannes Sixt
2011-09-23 18:13 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20110923T064720-366@post.gmane.org \
--to=nobozo@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.