From: Sverre Rabbelier <srabbelier@gmail.com>
To: Manuel Reimer <Manuel.Spam@nurfuerspam.de>
Cc: git@vger.kernel.org
Subject: Re: What happens if someone modifies repository without me knowing?
Date: Sun, 26 Sep 2010 21:16:33 +0200 [thread overview]
Message-ID: <AANLkTimUCGcM+OXqBOfHmGCaBamG27fjjz098-7GZ1G7@mail.gmail.com> (raw)
In-Reply-To: <i7o5rc$t3$1@dough.gmane.org>
Heya,
On Sun, Sep 26, 2010 at 21:07, Manuel Reimer <Manuel.Spam@nurfuerspam.de> wrote:
> How will GIT tell me about this hidden change? Will a "git pull" just bring
> this change into my working copy, whithout telling me about the change?
It will tell you it did a "forced update", assuming the other side has
been set as your upstream. If you do a pull (rather than a fetch) it
will try to apply the changes right away too.
Demonstration:
sverre@laptop-sverre:~/code
$ git init test
Initialized empty Git repository in /home/sverre/code/test/.git/
sverre@laptop-sverre:~/code
$ cd test/
sverre@laptop-sverre:~/code/test
$ echo "content" > foo
sverre@laptop-sverre:~/code/test
$ git add foo
sverre@laptop-sverre:~/code/test
$ git commit -m "Initial"
[master (root-commit) 9d48240] Initial
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 foo
sverre@laptop-sverre:~/code/test
$ echo "second line" >> foo
sverre@laptop-sverre:~/code/test
$ git commit -am "Proper second modification"
[master 8367122] Proper second modification
1 files changed, 1 insertions(+), 0 deletions(-)
sverre@laptop-sverre:~/code/test
$ cd ..
sverre@laptop-sverre:~/code
$ git clone test/ foo
Cloning into foo...
done.
sverre@laptop-sverre:~/code
$ cd test/
sverre@laptop-sverre:~/code/test
$ echo "and a third" >> content
sverre@laptop-sverre:~/code/test
$ git commit --amend -am "Tampered second modification"
[master 87d8e8a] Tampered second modification
1 files changed, 1 insertions(+), 0 deletions(-)
sverre@laptop-sverre:~/code/test
$ cd ../foo/
sverre@laptop-sverre:~/code/foo
$ git pull
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/sverre/code/test
+ 8367122...87d8e8a master -> origin/master (forced update)
Merge made by recursive.
--
Cheers,
Sverre Rabbelier
next prev parent reply other threads:[~2010-09-26 19:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-26 19:07 What happens if someone modifies repository without me knowing? Manuel Reimer
2010-09-26 19:16 ` Sverre Rabbelier [this message]
2010-09-26 20:23 ` Ilari Liusvaara
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=AANLkTimUCGcM+OXqBOfHmGCaBamG27fjjz098-7GZ1G7@mail.gmail.com \
--to=srabbelier@gmail.com \
--cc=Manuel.Spam@nurfuerspam.de \
--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 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).