From: Ivan Kanis <expire-by-2011-02-06@kanis•fr>
To: git@vger•kernel.org
Subject: problem when pulling a specific branch from origin
Date: Tue, 01 Feb 2011 18:25:55 +0100 [thread overview]
Message-ID: <877hdjy8d8.fsf@kanis.fr> (raw)
Hello,
When I pull a specific branch from a repository I get in a state where
git thinks I am ahead of the branch by one commit. The use case is a
programmer that doesn't want to pull all the branches of the server.
I have made a small script to reproduce the problem:
----
#!/bin/sh
rm -rf foo bar
git --version
mkdir foo
cd foo
git init
echo foo > foo.txt
git add foo.txt
git commit -am"foo"
git checkout -b branch
cd ..
git clone foo bar
cd foo
echo bar > foo.txt
git commit -am"bar"
cd ..
cd bar
git pull origin branch
git status
git branch -rv
----
I get the following output:
----
git version 1.7.3.5
Initialized empty Git repository in /home/ivan/tmp/foo/.git/
[master (root-commit) eefa065] foo
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 foo.txt
Switched to a new branch 'branch'
Cloning into bar...
done.
[branch 7ecd065] bar
1 files changed, 1 insertions(+), 1 deletions(-)
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/ivan/tmp/foo
* branch branch -> FETCH_HEAD
Updating eefa065..7ecd065
Fast-forward
foo.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
origin/HEAD -> origin/master
origin/branch eefa065 foo
origin/master eefa065 foo
----
I expected to not be ahead of origin/master and that origin/branch
points to 7ecd065. Is this a bug?
Take care,
--
Ivan Kanis
Sure, ninety percent of science fiction is crud. That's because ninety
percent of everything is crud.
-- Theodore Sturgeon
next reply other threads:[~2011-02-01 17:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 17:25 Ivan Kanis [this message]
2011-02-02 0:17 ` problem when pulling a specific branch from origin Konstantin Khomoutov
2011-02-02 9:54 ` Ivan Kanis
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=877hdjy8d8.fsf@kanis.fr \
--to=expire-by-2011-02-06@kanis$(echo .)fr \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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