From: Jakub Narebski <jnareb@gmail.com>
To: "Neshama Parhoti" <pneshama@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git push requires a subsequent git reset --hard ?
Date: Tue, 01 Jul 2008 10:29:38 -0700 (PDT) [thread overview]
Message-ID: <m3vdzpfr16.fsf@localhost.localdomain> (raw)
In-Reply-To: <912ec82a0807010951j9e970f2k9624682b33c8af7d@mail.gmail.com>
"Neshama Parhoti" <pneshama@gmail.com> writes:
> I took with me a copy of a local repository to a week away from my station
> (just rsync'ed it to my laptop).
>
> On my return, I just "git push myuser@my-station:/my/git/repo" from my laptop.
> It seemed to work with no probs.
>
> On my station the git repo got the new commits, as I can see in
> git-log, but the actual files were left untouched.
>
> So I need to do something like "git reset --hard HEAD" to get
> the changes into the local files.
>
> Is that considered normal ?
This is considered normal. Push would never touch index nor working
area (although if you are the only user, and you know what you are
doing, you can add "git reset --hard HEAD" to post-receive hook). It
is the only way: "push" cannot be opposite of "pull" and do a merge
because there is nobody to resolve conflict on remote side.
So you should either do mirroring (1:1 refspec) push into bare
repository (without working directory), or push into remotes section,
remotes/satellite or remotes/mothership, like shown in GitFaq, below.
See also:
* "Why won't I see changes in the remote repo after "git push"?"
http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73
* "How would I use "git push" to sync out of a firewalled host?"
http://git.or.cz/gitwiki/GitFaq#head-46de97a5ac549d3adf406c22674b3325ae25d09c
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2008-07-01 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 16:51 git push requires a subsequent git reset --hard ? Neshama Parhoti
2008-07-01 17:19 ` Jeff King
2008-07-01 17:29 ` Jakub Narebski [this message]
2008-07-02 13:36 ` Dmitry Potapov
2008-07-04 13:25 ` Neshama Parhoti
2008-07-02 13:45 ` Dmitry Potapov
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=m3vdzpfr16.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=pneshama@gmail.com \
/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 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).