Using mercurial on Windows 10.
I have a .hgignore which reads so
syntax: glob
._site/**
When I run hg status I get
? .hgignore
? _posts\T1C.save
? _site\Tate\index.html
? _site\X1Ct\index.html
? _site\o
? o
? o1
Why do I get the files under _site directory even though I have site/** inside .hgignore
I tried changing the \ in .hgignore to / - but it doesn't make a difference.
To ignore an entire directory, just use the pure directory name.
syntax: glob
._site
Mercurial on Windows can handle backslashes in ignore files.
Related
I have dynamic directory structure like,
dependency
a
b
c
d e
f
g
h
I want to ignore all files under dependency folder recursively except .xml files.
I am using below pattern to achieve the same.
dependencies/**
!dependencies/**/*.xml
But it seems it's not working for me. It's ignoring all the files but accepting only .xml files which are directly inside the dependency folder, not recursively. :(
I am using below environment.
OS : Windows 7(64 bit)
Git : 2.6.1.windows.1
Can anyone help me?
This should work:
You ignore everything but white-list the parent folders.
Then you can white-list files.
dependencies
!dependencies/**/
!dependencies/**/*.xml
As I mentioned in "How do I add files without dots in them (all extension-less files) to the gitignore file?", there is mainly one rule to remember with .gitignore:
It is not possible to re-include a file if a parent directory of that file is excluded.
That means, when you exclude everything ('*'), you have to white-list folders, before being able to white-list files.
Check if this is working with git check-ignore -v -- afile to see if it is ignored (and by which rule) or not.
I am trying to implement a basic string replacement in the header of my code with git filter clean feature.
Here is what I did so far:
I created a .gitattributes:
; Filters for .c, .h files
*.c filter=code_filters
*.h filter=code_filters
Then in my project config:
[filter "code_filters"]
clean = sed.exe -e "s/Project\s*:.*/Project : My Current Project/"
Since I am on Windows, I use sed from cygwin which is in my path.
The regular expression seems correct:
$ echo "Project :" | sed.exe -e "s/Project\s*:.*/Project : My Current Project/"
Project : My Current Project
Unfortunately, the filter syntax is not accepted. For any git command I get:
fatal: bad config file line 14 in .git/config
Could someone tell me what I am doing wrong here?
Note: I left the .exe extension to focus on the Windows aspect of my question. I'll remove it when it will work!
I got it working by escaping the / character so code looks like
[filter "code_filters"]
clean = sed -e 's/Project\\s*:.*/Project : My Current Project/'
I want to extract a specific directory form a huge zip file (>5GB) that is somewhat corrupted because of an inevitable bad maintained build system that creates the zip.
The tools such as winrar/7Zip GUI apps have no issues extracting the files, but some command line tools such as mks unzip and 7za fails to extract from the corrupted archive.
After a lot of digging around and trying out many such command line utilities I found out that IZARC successfully extracts files from the archive.
I am running the following command:
IZARCe.exe -e -d -o D:\aHugeZipFile.zip -pD:\temp #"source.txt"
The listing file source.txt contains just one entry:
source/lib/*
which is the only directory in the archive, from where the contents are to be extracted.
But, it is resulting in:
IZArc Command Line Extraction Add-On Version 1.1 (Build: 130)
Copyright(c) 2007 Ivan Zahariev, All Rights Reserved.
http://www.izarc.org contact#izarc.org
Archive File: aHugeZipFile.zip
WARNING: Nothing to do!
I have tried specifying:
/source/lib/*
source/lib/*
source/lib/
source/lib
*source/lib/*
in the listing file, all to no avail! :(
Any pointers on where the error is occurring, and how to fix the issue will be of great help. Thank you in advance!
Using relative or absolute paths for listfiles doesn't appear to work with IZArc. Try using wildcards such as ., *.doc, etc instead of paths in the listfile. Be aware that there appears to be a limitation for the folder depth that IZArc will extract to as well as a tendency to generate CRC errors when files with the same name are present in the same archive, even if they are in different directories.
I would suggest using 7-Zip command-line instead. It can recurse deeply through a file structure without error and can use relative directories and wildcards in its listfiles.
The following 7-Zip command was tested and worked perfectly.
7za x somearchive.zip -o"C:\Documents and Settings\me\desktop\temp_folder\test2" -ir#source.txt -aoa -scsWIN
the source.txt file may contain contain a combination of relative paths and/or wildcards on separate lines such as:
Output/, Folder2/, *, or *.doc.
In the command above: x (extract with full paths), -ir (include filenames, recurse subdirectories), -aoa (overide existing files without prompt), -scsWIN (set charset for list files). You may need to adjust these commands for your situation.
I have imported a huge hierarchy of maven projects into IntelliJ idea, now idea has created .iml projects on all different levels. I would like to svn:ignore these files.
There are several similar questions, for example this one: svn (subversion) ignore specific file types in all sub-directories, configured on root?
However: the answer is always to apply svn:ignore with the --recursive flag. That's not what I am looking for, I just want to ignore the files I created, not set a property on the hundreds of directories underneath.
Basically, what I have is the output of
svn status | grep .iml
which looks like this:
? foo/bar/bar.iml
? foo/baz/phleem.iml
? flapp/flapp.iml
etc.
What I would like to do is for each entry dir/project.iml to add svn:ignore *.iml to dir. I am guessing I have to pipe the above grep to sed or awk and from there to svn, but I am at a total loss as to the exact sed or awk command on one hand and the exact svn command (with which I won't override existing svn:ignore values) on the other hand.
Update: what I am also not looking for are solutions based on find, because possibly there are projects in this hierarchy where .iml files are in fact committed and I wouldn't want to interfere with those projects, so I'm looking to add the property only for .iml files my IDE has created.
You can set up your client to globally ignore given file extensions. Just add
global-ignores = *.iml
into your Subversion config file.
Update: If you want to only ignore iml files in the directories involved, you can try
svn status | grep '^\?.*\.iml' | sed 's=^? *=./=;s=/[^/]*$==' | xargs svn propset svn:ignore '*.iml'
I need to use SVN on Windows and would like to set it up such that line endings are always checked out in Windows style and always committed in Unix style, regardless which repository is used.
Is this possible or will I have to write a configuration file for each repo?
If I have to write a config file to each repo, where do I put it, what's the right filename, what goes into the file and what effect will it have on other users of the repo?
I made the following changes to the global SVN config file but it had no effect. What else do I need to do? Or will I have to call SVN with some specific parameters for changes to take effect on Windows?
enable-auto-props = yes
[auto-props]
*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.cxx = svn:eol-style=native
*.h = svn:eol-style=native
*.hpp = svn:eol-style=native
*.hxx = svn:eol-style=native
*.txt = svn:eol-style=native
*.tex = svn:eol-style=native
*.bib = svn:eol-style=native
You need to set the svn:eol-style property to native for all files in the repository. Autoprops will set the property for files newly added to a repository, but for existing files, you need to add the property manually:
svn propset svn:eol-style native example.c
svn commit
Daniel Roethisberger already gave you the correct answer. However you might want someway to ensure that all files have svn:eol-style set to `native.
I have a pre-commit hook that can ensure that the svn:eol-style property is set to native on all relevant files before it will allow a commit to take place. You might want to take a look at it to ensure that your policy is followed.
This command line android tool worked for me:
cd <install_dir>/adt-bundle-mac-x86_64-20140702/sdk/tools
./android list target
Make sure you pick a target listed above for the --target switch below.
./android create project --target 1 --name MyFirstApp \
--path ~/projects/android/MyFirstApp --activity MainActivity \
--package com.example.myfirstapp
This is documented at https://developer.android.com/training/basics/firstapp/creating-project.html
Then open eclipse and import the project created above.