From: "Paul Smith" <[email protected]>
On Mon, 2016-10-31 at 18:42 -0700, AD S wrote:
So I was working on a branch that had a total of 8 files. I needed to
make adjustments to 3 of those files. I pulled, made the changes and
pushed. Went to check on the branch on Git Hub and all of a sudden
everyone else's commits are on my branch. Over 2,800 files and 250+
commits.
I hate to step in here because usually messages like this are just
exercises in publicly venting frustration, rather than actual requests
for assistance.
However I don't quite understand what you mean, above. Every single
branch in Git represents a history from the HEAD of the branch (where
the branch tag points) back to the beginning of the repository.
So, when you say "everyone else's commits are on my branch" it's not
clear what what that refers to, but if you mean that you are seeing all
the commits back to the start of the repo, not just the commits "on your
branch", then that's expected: that's how it works.
AD S; Do you have a copy of the commands you used (from your History?).
I suspect that this is a misunderstanding about what 'pull' is doing, and
where it is pulling from (which maybe not where you expect!).
Pull will do two things::
First it will 'fetch' all the commits that are in the upstream of (normally,
IIRC) where you originally cloned the repo from, which often isn't your
personal repo on the server, so contains all the other upstream work.
Second, it will 'merge' all that usptream stuff into your personal branch.
If the usptream is "wrong/inappropriate", then you get all the hassle/extra
files.
Finally, when you push (which may be configured to be your personal
server!), you discover all the extra stuff.
Personally, I never use 'Pull' because of this issue. I use 'fetch' (to the
'remote tracking branches', which are actually local!), and then personally
pick off what I want.
Have a review of where the fetch/pull/push upstreams are located - you'll
need to understand "refspecs" for some of that - another powerful 'don't run
with scissors' feature ;-)
--
Philip
Pull was designed for an earlier era, using a different type of workflow
from that that is now commonly used.
--
You received this message because you are subscribed to the Google Groups "Git for
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.