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

  • SEARCH
  • Home
  • 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 8147841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:29:17+00:00 2026-06-06T14:29:17+00:00

I have some symlinks in my git repo which I work on from two

  • 0

I have some symlinks in my git repo which I work on from two machines (say A and B.) Both run Linux, but B is run through VirtualBox and the file system is shared from the Win7 host system. Thus, B does not support symlinks.

When doing some work on B I realized that using symlinks was a bad idea in my case. So on B I copied all the targets so that they’d overwrite the “symlinks.” Then I’d commit this, push it to my central repo, and then pull it on A.

The problem is on A where the files now have the permission of symlinks, but with the contents of the file. E.g. if the original file was a text file containing “Lorem ipsum dolor sit amet …” then the symlink would on A now point to the nonsensical path ‘Lorem ipsum dolor sit amet …’ and all file operartions on it would fail.

Example (to start with, foo.png is a symlink to ../bar.png, both are in the repo):

user@B> cat foo.png
../bar.png
user@B> cp ../bar.png ./foo.png
user@B> git add foo.png
user@B> git commit -m "Removed symlink"
user@B> git push

…

user@A> git pull
user@A> ls -l foo.png
lrwxrwxrwx 1 user user 8 2012-06-22 15:13 foo.png -> ?PNG????
user@A> git status foo.png
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   foo.png
#

I couldn’t figure out any way to remove the symlink flag from the files or do a checkout as normal files and I hope someone can help.

  • 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-06-06T14:29:21+00:00Added an answer on June 6, 2026 at 2:29 pm

    Should anyone else have this problem I found that the quick and dirty (and obvious) solution is:

    1. Delete the offending symlinks on A
    2. Copy the corresponding files from B to A.
    3. ‘git add’ the files
    4. Commit and push

    When you stage the files to commit they will be marked with

    user@A> git status .
    # [...]
    #     typechange: foo.png
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a git-repo which i clone onto my servers to do some administrative
I have a folder with some dotfiles I would like to make symlinks for.
Say I have a path to a file: /path/to/some/directory/file.ext In python, I'd like to
I have a directory to which a process uploads some .pdf files. This process
I have developed my little own framework, which depends on some model classes. I
Suppose I have a file fname which is a symlink to a file from
I have some c code which provides libfoo.so and libfoo.a along with the header
I have a folder A which contains some Python files and __init__.py. If I
I have some complex message to show inside of a flash message so instead
I have some html like the following: <div class=control-group> <input type=text data-bind=value: $data.DealCode name=DealCode

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.