简体   繁体   中英

Folder deleted on remote host AWS using git

I'm using git to upload my local files to amazon web service and I'm having this issue:

I've added a folder (images/members) to the gitinore file but it gets deleted on AWS when I do a git push. I just want to ignore any files and sub-folder under the images/members folder since the application create dynamic folders under it.

The step I did:

1) added the following line in the .gitignore file located in the web root:

images/members/

2) git init

3) git add .

4) git commit -m "test"

5) git aws.push

All my changes get published but the folder members but then when a member from my application creates a folder under images/members it gets deleted when I do another git aws.push. I just want to ignore the folder not deleting it.

Thanks

If git is already tracking these files, then you will have to git rm them then add them back.

There is the possibility that another .gitignore - either global or in that directory is overriding the settings, see man page entry for precendence:

order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome): Patterns read from the command line for those commands that support them.

   o   Patterns read from a .gitignore file in the same directory as the path, or in any
       parent directory, with patterns in the higher level files (up to the toplevel of the
       work tree) being overridden by those in lower level files down to the directory
       containing the file. These patterns match relative to the location of the .gitignore
       file. A project normally includes such .gitignore files in its repository, containing
       patterns for files generated as part of the project build.

   o   Patterns read from $GIT_DIR/info/exclude.

   o   Patterns read from the file specified by the configuration variable core.excludesfile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM