1

I would like to upload a locally modified GIT description file (i.e.: .git/description) to the remote.

For testing purpose, I created a brand new bare local repository:

$ mkdir test-remote && cd $_
$ git init --bare

Then, I:

  • cloned it to a specific directory.
  • made some changes to the cloned .git/description.
  • created an empty commit on a new master branch.
  • pushed master changes to origin.
$ git clone --local ./test-remote test
$ git checkout -b master
$ echo "TEST" > .git/description
$ git status
$ git commit --allow-empty -m "Initial commit."
$ git push origin master

However, I noticed that changes to .git/description don't appear in git status and does not appear in origin's local files after push either..

Is this file expected to be modified on the remote-side only? Is there a way to modify it locally and then upload it to the remote?

Although this question provides a good answer, the post is 12 years old and the solution is a bit tedious (creating symbolic links) regarding the number of repositories I own. Is there anything that could help in newer GIT versions?

Jib
  • 1,334
  • 1
  • 2
  • 12
  • The files inside `.git` are not tracked, because they are the inner workings of the repo itself. – evolutionxbox Dec 19 '22 at 11:30
  • You'd have to access the server itself and copy files manually, git won't do that for you I'm afraid. – Romain Valeri Dec 19 '22 at 11:38
  • @evolutionxbox I didn't really expect git to show this file in the git status. However, I was hoping it to "silently" push it to remote as part of its core files.. – Jib Dec 19 '22 at 12:33
  • @RomainValeri I was hoping git to "silently" push it to remote as part of its core files.. – Jib Dec 19 '22 at 12:34
  • 3
    Nothing changed in passed 12 years. Either you copy the file to the working tree outside of `.git/` and then add+commit+push. Or you copy the file with tools beyond `git`. – phd Dec 19 '22 at 12:49
  • @phd Too bad, I will go with editing files directly on the remote side then .. Thank you to the three of you for your time :) – Jib Dec 19 '22 at 17:39

0 Answers0