git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: merge vs. rebase question

From
Phil Hord <phil.hord@gmail.com>
Date
Jan 18, 2013, 18:38 UTC
Message-ID
<CABURp0rTNh4Xe4h6RwvDgQaBKJFq-ami-wO+X0mR5hiubaF7mw@mail.gmail.com>
In-Reply-To
<50F8073F.90304@bellsouth.net>
On Thu, Jan 17, 2013 at 9:14 AM, Dennis Putnam <dap1@bellsouth.net> wrote:
Show 14 quoted lines
> As a git noob I am having trouble understanding when to use which
> commands. I have a repository (bare) on my Linux server. I also created
> a build directory as a local repository. In my build script I do a 'git
> pull' to make sure the build directory is up to date. No changes are
> made to my source so this repository never does an 'add' or 'commit'.
> When I run my script with 'pull', the output indicates that changes were
> found and seems to have pulled them into the local directory. However,
> when I look at the resulting source, none of the expected changes show
> up. I then tried a 'fetch' and 'rebase'. That worked but I don't
> understand why. I thought 'pull' did a 'fetch' and a 'merge' so I don't
> understand why a 'fetch' and 'rebase' worked but 'fetch' and 'merge' did
> not. Unless my understanding of what 'pull' does is wrong. In my case,
> what should I be using in my script to assure that the build directory
> is current?

If your build directory never has any source changes or new commits, then pull is the right thing to do. You might want to use 'git pull --ff-only' to guarantee that your build directory is not creating merges unexpectedly.

You did not provide enough information to help figure out why your pull is failing to achieve the results you expect. I suggest you perform the pull manually in your build directory. If it fails, git should tell you why. If it reports success but actually fails, you can post a detailed explanation of the problem here so someone can suggest the cause.

Phil
Previous: Dennis PutnamNext: Dennis Putnam
Message 2 of 3 in “merge vs. rebase question”
  1. Dennis PutnamJan 17, 2013
  2. Phil HordJan 18, 2013
  3. Dennis PutnamJan 18, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.