Jump to content

my .gitignore file is being ignored - Why?


OrganizedFellow
 Share

Recommended Posts

I have created my .gitignore file at the root, alongside my .git folder.

But when I run $git status it shows modified: .gitignore

And beneath that, it shows the files that have been modified and are supposed to be ignored.

I've looked on StackOverflow earlier but couldn't find anything that worked.

Here's the content of my file:

/site/assets/cache/*
site/assets/cache/*
site/assets/cache/
/site/assets/sessions/*
site/assets/sessions/*
site/assets/sessions/
/site/assets/logs/*
site/assets/logs/*
site/assets/logs/
/site/config.php
site/config.php
project.sublime-workspace
project.sublime-project
Link to comment
Share on other sites

The .gitignore file itself is being shown as modified because you've probably added it to the git index at some point - either directly using "git add .gitignore" or perhaps as part of a larger add - and then a git commit (or a "git commit -a ..."). That's OK if the .gitignore file is meant to be part of your project. Anyway, if that's the case then git is correctly letting you know about a change to the .gitignore file since the last commit you made.

However, I'm not sure why other files that it's meant to be excluding are showing as modified.

Got to run. Will post later if something comes to me.

Link to comment
Share on other sites

@OrganizedFellow,

Question: Did you start off without a .gitignore file in your project root and add it at a later date? Possibly after an initial add and commit on your project? If so, git will continue to track what is already in the index - regardless of the content of your .gitignore file. More details here.

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By thmsnhl
      Hi everybody,
      we started our first Processwire driven project in my new company and for the first time, I was working on one site with more than 2 colleagues on the same site.
      It didn't take long for us to stumble across some problems when multiple developers work at the same time, conflicts with updating the database on vagrant machines, like duplicate entries for page IDs, errors when setting up fields and stuff like this. We ended up working on a dedicated database server, that we linked to our vagrant machines and most of the problems were gone, but the performance of this constellation is really bad compared to our first approach with database running on vagrant machines.
      I already tried to find a solution in the forums but I couldn't find anyone with problems like this.
      So I was wondering: how do you manage projects with multiple developers on vagrant machines in a git-based workflow?
    • By dst81
      Hi,
      I'm a System Administrator responsible for DevOps in our Company. We're trying PW in a single client project atm and experience some glitches with DevOps-/Workflow.
      We have a small team of developers that need to work with the same code base. They all need to be able to develop locally and deploy to a preview/staging environment.
      Our Toolstack contains git for versioning, chef/vagrant or docker for local development/testing and Jenkins for building assets and automatic deployment to the staging-site.
      There's several challenges / glitches in this process that makes me think that ProcessWire hadn't been developed for a use case like ours and is much more intended to be used by single developers that work right on the production system.
      Can you advise me on a suitable workflow?

      There's problems with the assets/files dir that must be shared between the staging website and local environments of our developers.
      We're right now working with symlinks on the staging system that helps to preserve the direcory when deploying from the master branch. but now we tend to use nfs-shares so devs can collaborate with a shared directory.

      The local docker containers can use the same target (the nfs) from inside the containers. But is that the way it needs to be done? Really?
      There's so much work that needs to be done to fit ProcessWire in a DevOps Workflow that we tend to decide to switch to another CMS.
       
      Any suggestions or hints that i might have missed. Am I wrong or is PW really not meant to be used this way. I
    • By louisstephens
      I was going to start working on a new site for myself and wife (a new hobby we have taken up), and had decided to try out Runcloud and Digital Ocean. I got my drop set up on digital ocean, as well as setting up various hooks/databases etc between github and run cloud. However, now I have hit a wall. 
      I cloned my "blank" repository into my local host (managed through MAMP) and dropped in a fresh install of PW, but now I have no idea of how to move forward. Is it best to just work locally, and then push this into a branch, and when ready, change branches and commit all to run cloud? Run cloud gives me an IP address to use for the database, but I can't get my localhost setup to recognize (I just get "Connection refused"). I am also unsure how to actually get my commits to push to run cloud, and handling the new set up.
      I am probably in over my head, but I thought I would try something new as a good learning experience. However, now I am just drowning  . Hopefully someone has some ideas on how to approach this, as I am very eager to get under way.
    • By Barry
      I'm attempting to deploy my site via GIT from bitbucket through Runcloud. I've managed to connect the repo via a webhook and I'm able to pull whenever I commit from local, but I keep getting a "Targetted directory /home/runcloud/webapps/domainname is not a GIT directory inside Web Application thedjcompany"
      I've always deployed via a GUI but we've moved servers and I'm very experienced with GIT, nor do I have any experience with Runcloud, so I'm hoping someone here has some info and can point me in the right direction?
      I'm guessing that I have to initiate the GIT folder within the webapp folder itself but I wouldn't know the command line to get that started.
      Any info/advise would be very appreciated
    • By benbyf
      Hey,
      Been using this starter theme for a little while now and thought I'd open it up on github - https://github.com/benbyford/bb-starter
      It has all my favourite modules installed, .less, some hany .js libraries and a set of blog templates for a simple news / blog setup. The theme is built on the simple theme from PW with additional setup. For more info see the Readme.md file on github.
      See it here - http://bbstarter.nicegrp.com/
      Thanks everyone for your continued work and fun using PW.
×
×
  • Create New...