Monday, 15 March 2010

Git repo does not have a .htaccess file, how do I create a local .htaccess that will not be removed by git pull --rebase -



Git repo does not have a .htaccess file, how do I create a local .htaccess that will not be removed by git pull --rebase -

the title might bit weird explanation of things go more detail here.

i have set git repo trough github website of can edit on our own computers , force changes webserver. have pull script on website git pull --rebase every few minutes, if there changes in repo.

now, not wish have username , password database on github, thinking of having .htaccess file locally on server holds username , password instead of having in php files. created .htaccess file locally, , added .htaccess in gitignore , gitattributes, whenever git pull --rebase updates .htaccess file removed. , if git rm .htaccess , git status says .htaccess has been deleted , have force file repo, though repo not have .htaccess file. , can't force either because server version of repo read-only.

any ideas?

update .gitignore file: ################# ## eclipse #################

*.pydevproject .project .metadata bin/ tmp/ *.tmp *.bak *.swp *~.nib local.properties .classpath .settings/ .loadpath # external tool builders .externaltoolbuilders/ # locally stored "eclipse launch configurations" *.launch # cdt-specific .cproject # pdt-specific .buildpath ################# ## visual studio ################# ## ignore visual studio temporary files, build results, , ## files generated popular visual studio add-ons. # user-specific files *.suo *.user *.sln.docstates # build results [dd]ebug/ [rr]elease/ *_i.c *_p.c *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.vspscc .builds *.dotcover ## todo: if have nuget bundle restore enabled, uncomment #packages/ # visual c++ cache files ipch/ *.aps *.ncb *.opensdf *.sdf # visual studio profiler *.psess *.vsp # resharper .net coding add-in _resharper* # installshield output folder [ee]xpress # docproject documentation generator add-in docproject/buildhelp/ docproject/help/*.hxt docproject/help/*.hxc docproject/help/*.hhc docproject/help/*.hhk docproject/help/*.hhp docproject/help/html2 docproject/help/html # click-once directory publish # others [bb]in [oo]bj sql testresults *.cache clientbin stylecop.* ~$* *.dbmdl generated_code #added ria/silverlight projects # backup & study files converting old project file newer # visual studio version. backup files not needed, because have git ;-) _upgradereport_files/ backup*/ upgradelog*.xml ############ ## windows ############ # windows image file caches thumbs.db # folder config file desktop.ini ############# ## python ############# *.py[co] # packages *.egg *.egg-info dist build eggs parts bin var sdist develop-eggs .installed.cfg # installer logs pip-log.txt # unit test / coverage reports .coverage .tox #translations *.mo #mr developer .mr.developer.cfg # mac crap .ds_store ################# ## project specific ################# # ignore htcaccess so pwd not public .htaccess # ignore pull script because server pull.php

i managed find solution (i hope) post on stackoverflow: .gitignore file not ignoring

and line did me was: git update-index --assume-unchanged <file>

git .htaccess github

No comments:

Post a Comment