dumbledad dumbledad - 9 months ago 60
Git Question

Copying my local git repository directory should result in the same status message, right?

I have a git repository on my Mac in the directory

. In that local repository if I run the
git status
command I see nothing outstanding:

$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

nothing to commit, working tree clean

If I go up a directory and copy my local git repository (
cp -r ThingaMeIOS TestFlightThingaMeIOS
) and then swap to the newly copied local repository and re-run the
git status
command I do have outstanding changes:

$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:

(use "git add/rm ..." to update what will be committed)

(use "git checkout -- ..." to discard changes in working directory)

deleted: Frameworks/HockeySDK.embeddedframework/HockeySDK.framework/Headers

typechange: Frameworks/HockeySDK.embeddedframework/HockeySDK.framework/HockeySDK

deleted: Frameworks/HockeySDK.embeddedframework/HockeySDK.framework/Resources

deleted: Frameworks/HockeySDK.embeddedframework/HockeySDK.framework/Versions/Current

deleted: Frameworks/HockeySDK.embeddedframework/Resources/HockeySDKResources.bundle

no changes added to commit (use "git add" and/or "git commit -a")

Surely these two local repositories should be identical and should give identical responses to the
git status
command. What is going on?

Answer Source

Looks like a copy issue. I use tar for copying git versioned folders:

cd /path/original; tar cvf - . | (cd /path/destination; tar xvf -)

Supports hidden files and symlinks. Very reliable - never had copy issues with this.