The root folder for my project is named demo and I'm trying to override it by adding a .gitattributes at the same level as the directory.
I have tried:
demo/** linguist-documentation
This doesn't seem to work, however.
What should I include instead so that the linguist will scan my project?
You can try .gitattributes directives mentioned in "Using gitattributes for linguist examples"
None of those includes the name of the repository, only folders/files inside the repository. See more at "ithub/linguist/blob Overrides / Using gitattributes"
In your case:
** linguist-documentation=false
Related
I uploaded my android studio project in java on GitHub but it is not showing languages section.
How do I add languages section. And why GitHub failed to detect languages used in repository?
Repository link - https://github.com/QAZIMAAZARSHAD/Bank-Android-App
https://i.stack.imgur.com/6C3il.jpg
These files are considered documentation by Linguist because they're in the app/ folder. You can use the following.
make a file name called .gitattributes this file will override that behavior and paste the following in that file.
app/* linguist-documentation=false
app/* linguist-vendored
I use helm-projectilein Emacs to search code in my codebase.
The structure of my codebase looks like this:
/rootdir
/project1
/.git
/code
/doc
/project2
/.git
/code
/doc
/project3
/...
I have three git repo and I only want to search in their code sub-directory. More importantly, when I do hlem-projectile-ack in project1. I want the search results to include the result from project2/code and project3/code.
By the default, helm-projectile only searches in the current git repo. How can I change the default search root to be /rootdir and also effectively ignore everything under /doc folders?
This can be solved by adding a .projectile under /rootdir
+project1/code
+project2/code
+project3
Reference: Projects in Projectile.
By the way, the documentation says that contents of .projectile are ignored when the
alien indexing method is used. I am using alien method and adding a .projecctile works for me.
Because of how Eclipse and EGit organize files and directories, I have my README.md file not in the root directory of my git repository but one folder deeper. How can I tell github to show some_folder/README.md as project's readme?
In the root directory of your repo, create a folder named .github.
Create a file named README.md in this folder.
Save the relative path of the file you want to use as the repo README in .github/README.md.
This causes README.md to be interpreted as a symbolic link (symlink) file.
Example:
This repo has files named README.md and cmod-readme.md in its root directory. Normally the former would be used as the README shown on the repo's main page, but instead the latter is used.
The repo contains a .github/README.md file, which contains the relative path to cmod-readme.md, i.e., ../cmod-readme.md.
The fact that GitHub will follow symlinks when locating a repo's README doesn't seem to be documented, although the .github folder is mentioned on this page in GitHub's docs:
If you put your README file in your repository's root, docs, or hidden .github directory, GitHub will recognize and automatically surface your README to repository visitors.
It's also interesting that (based on the example repo linked above) GitHub apparently prioritizes the README.md file in .github over a file of the same name in the respository's root.
This seemed to do it for me:
https://stackoverflow.com/a/49981731/7452130
Github wouldn't interpret my .github/README.md file as a symlink unless I created a symlink on my system and then pushed it.
I have a Laravel 4 project, and I would like to know which files should be ignored when using a version control software such as Git, Mercury or SVN?
The structure of my project looks like the following screen capture.
I'm pretty new to Composer so I'm not very clear about what goes to a repo what not. If someone can post their .gitignore file or their SVN ignore property, it could be handy.
For reference, that .gitignore file can be found here:
/bootstrap/compiled.php
/vendor
composer.phar
composer.lock # Remove this one after you create a project
.env.*.php
.env.php
.DS_Store
Thumbs.db
As noted in the below comment, you probably want to commit composer.lock in your project. Laravel ignores it by default so the authors of the laravel/laravel package don't accidently impose packages on you.
Your project should include the composer.lock file so you can install packages of stable versions (via composer install instead of composer update) properly in your production environments.
Note that the config file:
app/config/app.php
Has a cryptographic key in it that wouldn't be great to commit to a repository. Or, at least, the file needs to be overwritten in production.
You might also want to see the Laravel docs here and here. This discusses how to setup different Laravel configurations for different environments and protect sensitive information. All your .env.local.php type files should not be included in version control. Note that the .env.*.php and .env.php is added in the default Laravel .gitignore file. You can see it here
Laravel has posted their .gitignore on GitHub, which can be found here.
As of today, it looks like this:
/bootstrap/compiled.php
/vendor
composer.phar
composer.lock
.env.*.php
.env.php
.DS_Store
Thumbs.db
GitHub has a repository of suggested .gitignore files for almost all kinds of projects at: http://github.com/github/gitignore
Alternatively, you can search it for your project using this handy and extremely useful online tool: http://www.gitignore.io
I'm wondering where to put .hgignore file; in the main repository or each programmer should have it on his cloned copy?
Please clarify. Thanks.
You should put the file at the root of your repository.
See :
https://www.selenic.com/mercurial/hgignore.5.html
https://www.mercurial-scm.org/wiki/.hgignore
It says:
These files can be ignored by listing them in a .hgignore file in the root of the working directory. The .hgignore file must be created manually. It is typically put under version control, so that the settings will propagate to other repositories with push and pull.
Also another advantage is that, you might be working on multiple projects. Each having it's own set of pattern of files to ignore. For example, working on a Visual Studio project or a simple C++ project or a Python project. This ensures that patterns to ignore are relevant to the project.
How ever, you may not want to replicate these patterns in every ignore files. In such a case Mercurial configuration file can reference a set of per-user or global ignore files.
Example for global ignore files
in ~/.hgrc1:
[ui]
ignore = ~/.hgignore
in ~/.hgignore:
syntax: glob
*.tex
*.R
1 On Windows: %USERPROFILE%\mercurial.ini, ~ refers to %USERPROFILE% on Windows.
I've never seen it anywhere but the main repository.
How are you going to ignore the .hgignore without an .hgignore file in the repositry to ignore it ;P
Seriously.. it should probably be in the repository, since the files to be ignored are respositry-specific; a user can of course specify their own ignores additionally in a file specified in their .hgrc
you can have a global one inside your ~/.hgrc directory or a project specific one inside
the project's root directory
It belongs in the top folder of the repository. It is not meant for personal ignores but for project-wide ignores (i.e. applying for everyone). However, usually developers will add e.g. their faviourite editor's temp. files to that file - doesn't hurt anyone.
If you want to ignore something others probably do NOT want to ignore, put it in your personal ignore in ~/.hgrc.