.gitignore file not working in GitHub(AWS) - aws-code-deploy

When we pull a revision from Github than it is not ignoring the files and directories which are placed in .gitignore file.
It is pulling all the files and directories.
How to resolve this issue? I need to ignore some files and directories when pulling from github.
This is how my current .gitignore file looks like -
/vendor
/node_modules
Homestead.yaml
Homestead.json
.env
.idea/workspace.xml
/config/test
/storage/logs/laravel.log

I suspect what is happening is, the files you are trying to ignore using .gitignore were previously tracked (before ignore statements were added).
So to make the repository forget the files in git ignore look at this answer here:
How to make Git "forget" about a file that was tracked but is now in .gitignore?
That being said, if you actually "mean" exactly what you have written in your question, that suggests your understanding of how .gitignore works is flawed.
.gitignore does not prevent the files from being pulled down from the repository. It prevents them from getting committed to a repository in the first place.

Related

Can build_site() not overwrite .gitignore in public/?

I'm following the suggestion on this section to put the public/ folder under version control. Hugo seems to generate an automatic .gitignore files every time I build the site. The default .gitignore ignores everything except itself. Now after I run build_site(), I need to manually overwrite the default .gitignore for the changes to show up.
Is there an option that can turn off the overwriting of .gitignore?
I experienced a similar problem when generating my site with a theme I forked from github. I use git to to track changes in the course files and then to push the generated site to GitHub where the site is hosted. I created a .gitignore file in the source files for the hugo site so it would ignore .DS_Store and .icloud files but when I ran hugo -D, the .gitignore file in the generated site repo would also be modified but appear empty.
The issue was that there was extra .gitignore files lurking in the template and theme files that I had forked. Deleting them with and regenerating the site files from source without running hugo mod clean --all fixed the issue.

How to ignore .dll files from all directories

I have a project and it has a lot of directories containing .dll files. Now I want to ignore all files having .dll extension from all directory. I have .gitignore file in root directory.I tried many combinations but none seems to work.
Please help
Just use
*.dll
That will ignore all .dll files recursively, in all folders.
Ignoring files
From time to time, there are files you don't want Git to check in to GitHub. There are a few ways to tell Git which files to ignore.
Create a local .gitignore
If you create a file in your repository named .gitignore, Git uses it to determine which files and directories to ignore, before you make a commit.
A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.
GitHub maintains an official list of recommended .gitignore files for many popular operating systems, environments, and languages in the github/gitignore public repository.
In Terminal, navigate to the location of your Git repository.
Enter touch .gitignore to create a .gitignore file.
The Octocat has a Gist containing some good rules to add to this file.
If you already have a file checked in, and you want to ignore it, Git will not ignore the file if you add a rule later. In those cases, you must untrack the file first, by running the following command in your terminal:
git rm --cached FILENAME
Create a global .gitignore
You can also create a global .gitignore file, which is a list of rules for ignoring files in every Git repository on your computer. For example, you might create the file at ~/.gitignore_global and add some rules to it.
Open Terminal.
Run the following command in your terminal:git config --global core.excludesfile ~/.gitignore_global

grunt not ignoring files and not ordering the files as per the command

Grunt is not ignoring files besides it's not loading the files as per the priority given in gruntjs Please check the image
There is no image attached, but did you add the folder or file to the .gitignore file after they were already commited? In that case you might need to clear the git cache. See link below
How to make Git "forget" about a file that was tracked but is now in .gitignore?

Meteor.JS: How to Remove All Packages from a Project

I want to remove the meteor installation from my meteor project directory while keeping my source code intact, so that I can archive the project without the installed packages. I also want the package configuration to be retained in the archive so that I can re-install the project without having to re-add and re-remove the packages again.
How do I do this?
Meteor already creates a .gitignore file for you. That file tells you everything that should be archived. So you can simple look at that file and only archive that (either by deleting everything else, or just writing a script that reads the .gitignore file and interprets it). Alternatively, of course, you could just add everything to git (in which case git will interpret the .gitignore file for you), and then create an archive from the git repo.
Of course, that .gitignore file only excludes .meteor/local, so as Kyll already said, you could just delete that folder.

Bitbucket not showing changes in themes directory

I'm using Sourcetree on OS X. I'm working on a WordPress project. For some reason, changes I make in the 'themes' directory are not being shown as Unstaged files. If I add a test file to /wp-admin/ or /wp-content/ it shows the test file as unstaged. I can't figure out why themes files are not being tracked.
I checked .gitignore and it's empty.
Any help is appreciated. Thanks!
To clarify the question. If SourceTree fails to recognize un-tracked files here are some steps you should take.
Double check that you are not listing the file/directory in .gitignore
Open up a GIT console for that repository and run git status This should show whether any changes are detectable by GIT.
Go to the directory in which you are having problems and look to see if you have any .gitignore files or .git folders. If they exist then deleting them should allow you to add these files to your repository
Caution:
Sometimes having a Repo inside a repo is by design (often referred to as a sub-repository) and could cause issues if removed.
Edit:
I just replicated this scenario with two repos and source tree appeared to see the untracked files once the .git was removed.
Could you open up a terminal window to that themes directory and do an ls -a?
If you use SourceTree, open the terminal and use git add <fileName> -f to force shown any changes in this folder then you can push to Bitbucket

Resources