Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7676383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:11:14+00:00 2026-05-31T17:11:14+00:00

I often switch back and forth between branches. I have a script which pushes

  • 0

I often switch back and forth between branches. I have a script which pushes the contents of the checkout to a ‘running’ environment where I can see the code run and test it (it’s a web app). This push script uses rsync at its heart and it uses timestamps to detect what files should really be transferred. Because ‘git-checkout’ seems to set the timestamps on the files to the current time, rsync reports all files are being pushed up, only because timestamps will be updated.

How can I have ‘git-checkout’ retain timestamps when switching between branches so that rsync will report only content changes?

I do not want to use rsync’s checksum argument as it is very slow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:11:15+00:00Added an answer on May 31, 2026 at 5:11 pm

    The reason that git checkout updates timestamps is that almost all build systems for source code depend on timestamps to determine if targets need to be rebuilt. If git checkout did not update timestamps on files when they are updated, these build systems would not correctly do an incremental build. In fact, git checkout should only update timestamps on files that have changed.

    rsync should be efficient in updating time stamps, and not transfer any data if only metadata has changed. You can verify this with the "speedup". You can also ask recent versions of rsync to itemize changes with the -i flag. You can tell rsync not to use timestamps (and only use checksums) by leaving out -a or -t, but that’s not recommended by the rsync(1) man page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often switch to different branches, how can I check to which branch SVN
I have several working sets in my eclipse which i often switch from one
I use the Shift + F7 often to switch between source and design view.
I often (using the mouse) switch between 1 of 3 favorite folders under my
It's quite often the case that my selenium script will be running, and then
I often switch between MonoDevelop on Linux and VS2010 with the same code base
I had an SVN background before and I get used to working between branches
In a tab-based app when I switch between some tabs, I sometimes get EXC_BAD_ACCESS
I use the switch feature of Subversion quite often, but sometimes I forget where
Long switch statments are often frowned upon. The solution is to use polymorphism. However

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.