The title might be a bit weird explanation of things so I will go into more detail here.
I have set up git repo trough github for a website so all of us can edit on our own computers and then push changes to the webserver. I then have a pull script on my website that does git pull --rebase
every few minutes, if there are changes in the repo.
Now, I do not wish to have the username and password for the database on github, so I was thinking of having a .htaccess file locally on the server that holds the username and password instead of having it in the php files. So I created a .htaccess file locally, and added .htaccess in gitignore and gitattributes, but whenever I do a git pull --rebase
the updates to the .htaccess file are removed. And if I do git rm .htaccess
and git status
it says that .htaccess has been deleted and that I have to push the file to the repo, even though the repo does not have any .htaccess file. And I can't push either because the server version of the repo is read-only.
Any ideas?
Update with .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, and
## files generated by 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 you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Installshield output folder
[Ee]xpress
# DocProject is a 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 for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we 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 so pwd is not public
.htaccess
# Ignore the pull script because this is only for the server
pull.php
I managed to find a solution (I hope) from this post on stackoverflow: Ignore files that have already been committed to a Git repository
And the line that did it for me was: git update-index --assume-unchanged <file>