directory-structure


Is it safe to clone a git repository into its own .git directory?


I recently put my website under Git version control. I'm using git-ftp to upload files, and I've set it up so that the master branch is the content that should be on the server, and the live branch is the content that actually is on the server. I need to make this distinction since I sometimes develop where I don't have an Internet connection, and therefore can't upload right away. Therefore, in order to upload, I do: git checkout live;git merge master;git ftp push; I'd like to automate this process and not lose the rest of working directory state. In the future I'm also going to set up automatic backups of several files which will be ftp'ed down and committed to the live branch.
In order to do all of this, I'm going to need another clone that will only be used by automated processes, and will always have a clean working directory. The obvious place to put it, since it will never need to be looked at, is inside the .git directory of the main repository. That way, I don't have a clone floating off somewhere else in my filesystem, it stays hidden, and it's obvious that it's part of the internals and shouldn't be poked about with. If this works well, I may even submit a patch to fix git-ftp issue #180 with this method.
However, I'm not sure if it's a good idea to put random things inside the .git folder--I can't find any documentation anywhere on what the side effects may be.
A .git directory seems to ignore completely any extra elements, so adding a git repo directly in .git should work.
That wouldn't work if you added your nested repo in a sub-directory like, for example, .git/refs (see Git Internals - Git References)
Note that you could also have that git repo anywhere in your current git repo, as a directory named, for instance, .ftprepo (a name beginning with a dot, which should be hidden by default)
I found the answer by mistake while looking for something else!
According to https://www.kernel.org/pub/software/scm/git/docs/#_file_directory_structure, "Higher level SCMs may provide and manage additional information in the $GIT_DIR". This appears to mean that additional info can be stored in .git without causing problems, including, presumably, another clone of the repository.

Related Links

can I place the js,css,images files under resources folder and place this resource folder under src/main/webapp folder?
VMS directory issue
SaltStack: Use directory as source only if it exists
Is it safe to clone a git repository into its own .git directory?
CAB Files MAKECAB.exe Way to store directory structure
how do I create the URL “m.mysite.com” from mysite.com?
URL structure for inner pages?
Ideal directory structure for web application
Development directory Structure [closed]

Categories

HOME
java
listview
netbeans
google-api-php-client
layout
sd-card
sqlite-net-extensions
analysis
jxls
umd
ezpublish
synchronization
awesome-wm
primary-key
dax
zend-framework3
carthage
ghc
libtiff
facebook-page
reverse-proxy
java-3d
shopware
tooltipster
greendao
webkitspeechrecognition
iframe-resizer
bosh
airconsole
adobe-premiere
swift3.0.2
libvpx
jna
trim
acoustics
s
osx-mavericks
tizen-native-app
aurelia-validation
directory-structure
knpmenubundle
qtwebview
blacklist
color-picker
nxt
azure-virtual-network
file-writing
nsviewcontroller
sigabrt
hover-over
pickadate
hexdump
oauth2client
vhd
qtableview
lib.web.mvc
thredds
jmeter-maven-plugin
simple-framework
purge
graph-drawing
mmc
kineticjs
modalpopup
dd
angularjs-ng-click
titanium-modules
reactfx
mechanize-ruby
typo3-neos
flash-builder4.5
cos
qt-faststart
yui-compressor
lcs
type-equivalence
simba
gil
mt
multipage
ticoredatasync
qtkit
custom-backend
xdomainrequest
calling-convention
locate
javap
phonon
scripting-languages
geneva-server
multiple-languages

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile