Ignoring files under config folder of codeigniter using github not working - github

I am using codeigniter framework to develope simple application. I want to push my code to github repo. While publishing my code to repo i want to ignore set of files in config folder such as config.php, database.php etc. I have downloaded codeigniter 3.1.11 from official website. I have been using following conditions inside my .gitignore file but none of them are working for me. I have tried all possible combinations of below conditions.
/application/config/
/application/config/*
/application/config/*.php
/application/config/database.php
/application/config/config.php
application/config/
application/config/*
application/config/*.php
application/config/database.php
application/config/config.php
config/config.php
config/*
/config/*.php
*/config
Whenever i change my config file for localhost setup and check the status it displays config file has been modified, and changes ready to be staged.
Help me to get throught this problem. I have tried all the possible options over the internet as well but none of them are working.

First, whenever a .gitignore set of rule does not work for a given file, check why with:
git check-ignore -v -- /path/to/file/which/should/be/ignored
Second, it is easier to put a .gitignore in the config folder itself, and list the files you don't want.
Third, for any file you want to be ignored, double-check they are not already tracked:
git rm --cached file_to_ignore

Related

How to create a new file in github and add there existing files?

I have files in repository. I want them to be grouped inside a folder. How can I do this?
It seems that I need to add new file if I want to create a folder.
From how you worded your question, it seems like you're trying to work on github directly from the website.
The usual way github works is:
if you have a repo on github and you want to modify it, first 'clone' the repo into your local computer,
use these instructions https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
then just change folder structure like you would normally on File Explorer (windows) or Finder (mac),
then follow the commit instructions and 'push' up your changes to github
use these instructions
check status of your recent changes:
git status
add the files that you want to include in the commit
git add nameOfFile
check status and the file you want to include should now be green
git status
use this to send to github
git push
Overall github docs here:
https://learn.microsoft.com/en-us/training/modules/introduction-to-github/

stop git from tracking a file without removing the file from other developers machine

I have a file name settings.py. In my host machine settings.py has a different configuration with that of other developers. I want to stop git from tracking settings.py but not to delete this file from other developers machine when ever they pull changes in the project
Some people talk about including the file in .git/info/exclude folder.
But i have no idea as where to locate this file. I searched for it in my project folder( where git has been initialize). To no avail.
expected result
When ever i commit changes, all changes are push to master except my settings.py file, but not deleting this file from other developers machine when ever they pull my changes.
You already mentioned the correct answer. You can use .git/info/exclude as also documented here.
If you have not created this file yet, you can do so now. Simply place a text file called exclude in .git/info. The .git folder should be present already in the root of your repository.
The file uses the same syntax as a regular .gitignore file, but will only be applied to you.
You can also manually specify a core.excludesfile as described in this answer:
git config --global core.excludesfile ~/.gitignore

Github Desktop not detecting db.sqlite

I'm currently deploying a Django project to Github using Github Desktop.
All changes are successfully detected and commited, except for db.sqlite3
When I copy that file to "Documents/Github/my-repository", there is no change and I can't commit.
I tried to pull but it doesn't work
Check the file .gitignore to see if that file is not black-listed. The .gitignore file is used to prevent files and directories from being committed. Read more here.

yii2 vendor and some files are missing from github

I have set up a new repo on github and pushed yii2 advanced template. Now i realized that some folders/files are missing from github like vendor and backend/web/index.php.
Anyone have idea why this is happening, i also checked my local git setup there files are present.
Check out the installation guide.
Running composer install is what creates the vendor folder, while running init creates those index.php files.
I have found that its happening because of .gitignore file. i removed it and its working fine for me.
It's quite simple idea behind missing these files, they are called ...-local.php, because their content can vary for different developers or production conditions. All you have to do before upload yii2 to the github, check the /environments directory, it includes templates for the local files, so after yii2 project is copied from the github, they will be generated by ./yii init.
Step-by-step, what should be done:
Configure files in /environments/dev and /environments/prod (for production). Most likely, if you don't change the yii2 project file structure or touch any of the /config files, you don't need to adapt them.
Update /environments/index.php, if you have updated /environments files
Upload the project to GitHub
Clone the project and run composer install to install dependencies
And finally run ./yii init from the root folder. You will see that ...-local.php files are now generated in certain directories the same way as they are configured in the environments.
More detailed information about this topic: https://www.yiiframework.com/extension/yiisoft/yii2-app-advanced/doc/guide/2.0/en/structure-environments

important files are not in list , all some files go in untract files list?

I am using a Git Repository to manage my project,
Now when i try to commit i see there are some impoertant file like content/image , scripts , etc files in untrack files
Why?
Is there any way to resolve this?
Regards,
vinit
You have to use "git add [wildcard or directory or file(s)]" first to add your files to the versioning system GIT. Manual page is here: https://www.kernel.org/pub/software/scm/git/docs/git-add.html
And the git book is worth a read.
Also I liked gitready very much.
Happy coding
If your Git repo has been initialized on GitHub (and then cloned), it is likely to come with a .gitignore (as well as a README.md, and even a LICENSE file).
Check if those files aren't ignored by the rules in the .gitignore.
You can do that with:
git check-ignore -v scripts
You can edit that file to remove the rules you don't want, then a git add . will add:
the modified .gitignore files
the files that were previously ignored.