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

RE: pull failed - why should I receive this message.

From
RSRussell, Scott <scott.russell2@ncr.com>
Date
Sep 24, 2021, 20:13 UTC
Message-ID
<BN6PR15MB1426EBF10C9E8634EF317DDBCBA49@BN6PR15MB1426.namprd15.prod.outlook.com>
In-Reply-To
<YU4vG0TI+BkK6xiW@camp.crustytoothpaste.net>
Brian,  
You are correct.  This is a build system.  And your responses are the most useful so far.  
"git fetch origin" - okay 
For this one, is there a way to specify just the head?   I just want the latest - and don't want to try to figure out what 'Revision' may be. 
"git checkout -f REVISION"
Thanks, 
Scott Russell
NCR Corporation 
       
-----Original Message-----
From: brian m. carlson <sandals@crustytoothpaste.net> 
Sent: Friday, September 24, 2021 4:04 PM
To: Russell, Scott <Scott.Russell2@ncr.com>
Cc: Randall S. Becker <rsbecker@nexbridge.com>; 'Emily Shaffer' <emilyshaffer@google.com>; git@vger.kernel.org
Subject: Re: pull failed - why should I receive this message.
*External Message* - Use caution before opening links or attachments
On 2021-09-24 at 18:36:51, Russell, Scott wrote:
Show 8 quoted lines
> Randall,
> 
> Thanks for your answer.   However, this is a build system.
> Git clean -dxf would delete all untracked files - not just the conflicted ones.
> 
> We must keep all untracked files that would not be conflicted by the pull.
> Otherwise, the result would be our build would need to do a fresh build of all objects and build targets - those are all untracked as well.
> Instead of the desired case of just building the changed files and their resultant targets.

Note that a "git clean -dxf" will clean even ignored files. If you just need to clean untracked files, you can do "git clean -df" (without the -x) and then your ignored files will not be deleted.

> We just need the pull to overwrite any untracked files that may exist in conflict with newly tracked files.
> 
> I see git is troublesome in this situation.   Every time a developer adds an untracked file to the repo - regardless of type,
> It will result in failure of the pull.   And a failure of the build.
I do strongly agree with Emily that build artifacts should not be tracked in the repository and that the best way to solve it is to address that problem.

However, if your goal is to just update the working tree to a specific revision, rather than to potentially merge that commit into the working directory, you can use "git fetch origin" to fetch the remote, and then use "git checkout -f REVISION" to check out the branch and destroy local changes. I suspect in your case, since this is a build server, that checking out a specific revision is the intended behavior. -- brian m. carlson (he/him or they/them) Toronto, Ontario, CA

Previous: brian m. carlsonNext: brian m. carlson
Message 9 of 11 in “pull failed - why should I receive this message.”
  1. Russell, ScottSep 24, 2021
  2. Emily ShafferSep 24, 2021
  3. Russell, ScottSep 24, 2021
  4. Randall S. BeckerSep 24, 2021
  5. Russell, ScottSep 24, 2021
  6. Emily ShafferSep 24, 2021
  7. Russell, ScottSep 24, 2021
  8. brian m. carlsonSep 24, 2021
  9. Russell, ScottSep 24, 2021
  10. brian m. carlsonSep 24, 2021
  11. Russell, ScottSep 24, 2021

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.