Re: What happens if someone modifies repository without me knowing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Heya,

On Sun, Sep 26, 2010 at 21:07, Manuel Reimer <Manuel.Spam@xxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]