2013-02-19 36 views
0

標題可能有點怪異的解釋,所以我會在這裏詳細介紹一下。Git repo沒有.htaccess文件,我如何創建一個不會被git pull刪除的本地.htaccess --rebase

我已經爲網站設置了git repo trough github,所以我們所有人都可以在我們自己的計算機上進行編輯,然後將更改推送到網絡服務器。然後,我在我的網站上有一個拉動腳本,如果回購有變化,則每隔幾分鐘進行一次git pull --rebase

現在,我不希望在github上擁有數據庫的用戶名和密碼,所以我想在服務器上保存一個.htaccess文件,該文件保存用戶名和密碼,而不是在php文件中。所以我在本地創建了一個.htaccess文件,並在gitignore和gitattributes中添加了.htaccess,但是每當我執行git pull --rebase時,對.htaccess文件的更新都將被刪除。如果我做git rm .htaccessgit status它說,.htaccess已被刪除,我必須將文件推送到回購,即使回購沒有任何.htaccess文件。而且我也無法推送,因爲回購的服務器版本是隻讀的。

任何想法?

更新用的.gitignore文件: ################# ##的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 
+0

請出示你的'.gitignore'文件。 – BetaRide 2013-02-19 13:08:41

+0

我現在添加了gitignore。 – Fumler 2013-02-19 13:13:02

回答

相關問題