Search Results

Search found 75 results on 3 pages for 'gitignore'.

Page 1/3 | 1 2 3  | Next Page >

  • Fixing up Visual Studio’s gitignore , using IFix

    - by terje
    Originally posted on: http://geekswithblogs.net/terje/archive/2014/06/13/fixing-up-visual-studiorsquos-gitignore--using-ifix.aspxDownload tool Is there anything wrong with the built-in Visual Studio gitignore ???? Yes, there is !  First, some background: When you set up a git repo, it should be small and not contain anything not really needed.  One thing you should not have in your git repo is binary files. These binary files may come from two sources, one is the output files, in the bin and obj folders.  If you have a  gitignore file present, which you should always have (!!), these folders are excluded by the standard included file (the one included when you choose Team Explorer/Settings/GitIgnore – Add.) The other source are the packages folder coming from your NuGet setup.  You do use NuGet, right ?  Of course you do !  But, that gitignore file doesn’t have any exclude clause for those folders.  You have to add that manually.  (It will very probably be included in some upcoming update or release).  This is one thing that is missing from the built-in gitignore. To add those few lines is a no-brainer, you just include this: # NuGet Packages packages/* *.nupkg # Enable "build/" folder in the NuGet Packages folder since # NuGet packages use it for MSBuild targets. # This line needs to be after the ignore of the build folder # (and the packages folder if the line above has been uncommented) !packages/build/ Now, if you are like me, and you probably are, you add git repo’s faster than you can code, and you end up with a bunch of repo’s, and then start to wonder: Did I fix up those gitignore files, or did I forget it? The next thing you learn, for example by reading this blog post, is that the “standard” latest Visual Studio gitignore file exist at https://github.com/github/gitignore, and you locate it under the file name VisualStudio.gitignore.  Here you will find all the new stuff, for example, the exclusion of the roslyn ide folders was commited on May 24th.  So, you think, all is well, Visual Studio will use this file …..     I am very sorry, it won’t. Visual Studio comes with a gitignore file that is baked into the release, and that is by this time “very old”.  The one at github is the latest.  The included gitignore miss the exclusion of the nuget packages folder, it also miss a lot of new stuff, like the Roslyn stuff. So, how do you fix this ?  … note .. while we wait for the next version… You can manually update it for every single repo you create, which works, but it does get boring after a few times, doesn’t it ? IFix Enter IFix ,  install it from here. IFix is a command line utility (and the installer adds it to the system path, you might need to reboot), and one of the commands is gitignore If you run it from a directory, it will check and optionally fix all gitignores in all git repo’s in that folder or below.  So, start up by running it from your C:/<user>/source/repos folder. To run it in check mode – which will not change anything, just do a check: IFix  gitignore --check What it will do is to check if the gitignore file is present, and if it is, check if the packages folder has been excluded.  If you want to see those that are ok, add the --verbose command too.  The result may look like this: Fixing missing packages Let us fix a single repo by adding the missing packages structure,  using IFix --fix We first check, then fix, then check again to verify that the gitignore is correct, and that the “packages/” part has been added. If we open up the .gitignore, we see that the block shown below has been added to the end of the .gitignore file.   Comparing and fixing with latest standard Visual Studio gitignore (from github) Now, this tells you if you miss the nuget packages folder, but what about the latest gitignore from github ? You can check for this too, just add the option –merge (why this is named so will be clear later down) So, IFix gitignore --check –merge The result may come out like this  (sorry no colors, not got that far yet here): As you can see, one repo has the latest gitignore (test1), the others are missing either 57 or 150 lines.  IFix has three ways to fix this: --add --merge --replace The options work as follows: Add:  Used to add standard gitignore in the cases where a .gitignore file is missing, and only that, that means it won’t touch other existing gitignores. Merge: Used to merge in the missing lines from the standard into the gitignore file.  If gitignore file is missing, the whole standard will be added. Replace: Used to force a complete replacement of the existing gitignore with the standard one. The Add and Replace options can be used without Fix, which means they will actually do the action. If you combine with --check it will otherwise not touch any files, just do a verification.  So a Merge Check will  tell you if there is any difference between the local gitignore and the standard gitignore, a Compare in effect. When you do a Fix Merge it will combine the local gitignore with the standard, and add what is missing to the end of the local gitignore. It may mean some things may be doubled up if they are spelled a bit differently.  You might also see some extra comments added, but they do no harm. Init new repo with standard gitignore One cool thing is that with a new repo, or a repo that is missing its gitignore, you can grab the latest standard just by using either the Add or the Replace command, both will in effect do the same in this case. So, IFix gitignore --add will add it in, as in the complete example below, where we set up a new git repo and add in the latest standard gitignore: Notes The project is open sourced at github, and you can also report issues there.

    Read the article

  • How do gitignore exclusion rules actually work?

    - by meowsqueak
    I'm trying to solve a gitignore problem on a large directory structure, but to simplify my question I have reduced it to the following. I have the following directory structure of two files (foo, bar) in a brand new git repository (no commits so far): a/b/c/foo a/b/c/bar Obviously, a 'git status -u' shows: # Untracked files: ... # a/b/c/bar # a/b/c/foo What I want to do is create a .gitignore file that ignores everything inside a/b/c but does not ignore the file 'foo'. If I create a .gitignore thus: c/ Then a 'git status -u' shows both foo and bar as ignored: # Untracked files: ... # .gitignore Which is as I expect. Now if I add an exclusion rule for foo, thus: c/ !foo According to the gitignore manpage, I'd expect this to to work. But it doesn't - it still ignores foo: # Untracked files: ... # .gitignore This doesn't work either: c/ !a/b/c/foo Neither does this: c/* !foo Gives: # Untracked files: ... # .gitignore # a/b/c/bar # a/b/c/foo In that case, although foo is no longer ignored, bar is also not ignored. The order of the rules in .gitignore doesn't seem to matter either. This also doesn't do what I'd expect: a/b/c/ !a/b/c/foo That one ignores both foo and bar. One situation that does work is if I create the file a/b/c/.gitignore and put in there: * !foo But the problem with this is that eventually there will be other subdirectories under a/b/c and I don't want to have to put a separate .gitignore into every single one - I was hoping to create 'project-based' .gitignore files that can sit in the top directory of each project, and cover all the 'standard' subdirectory structure. This also seems to be equivalent: a/b/c/* !a/b/c/foo This might be the closest thing to "working" that I can achieve, but the full relative paths and explicit exceptions need to be stated, which is going to be a pain if I have a lot of files of name 'foo' in different levels of the subdirectory tree. Anyway, either I don't quite understand how exclusion rules work, or they don't work at all when directories (rather than wildcards) are ignored - by a rule ending in a / Can anyone please shed some light on this? Is there a way to make gitignore use something sensible like regular expressions instead of this clumsy shell-based syntax? I'm using and observe this with git-1.6.6.1 on Cygwin/bash3 and git-1.7.1 on Ubuntu/bash3.

    Read the article

  • .gitignore does not understand my folder wildcard on windows

    - by Martin Aatmaa
    I'm encountering a weird issue with .gitignore on Windows. I want git to ignore all .exe files, except those in the Dependencies folder (and all subfolders). So I have: .gitignore: *.exe !/Dependencies/**/*.exe This, unfortunately, does not work. Meanwhile, this does: *.exe !/Dependencies/folder/subfolder/*.exe So I'm wondering, am I messing something up, or is this some kind of bug? I'm running msysgit on Windows (Windows 7 x64) version 1.6.5.1-preview20091022 Thanks in advance for any input :)

    Read the article

  • Git subtree not properly using .gitignore when doing a partial clone

    - by D W
    I am a graduate student with many scripts, bibliography data in bibtex, thesis draft in latex, presentations in open office, posters in scribus, and figures and result data. I would like to put everything in one project under version control. Then when I need to work on a portion such as the bibliography data, I would like to check that subdirectory out, modify it as necessary and merge it back.I would like the ability to check out one version to my home computer, and a different one to my work computer and make changes to each independently and eventually merge them back. I would also like to be able to check out a piece of code from this big project and import it with versioning into a separate project. If I may changes I'd like to be able to merge them back to the original project. Based on my understanding git subtree can do this. http://github.com/apenwarr/git-subtree There is an example that is along the lines of what I'm trying to do at: http://psionides.jogger.pl/2010/02/04/sharing-code-between-projects-with-git-subtree/ Say the trunk of my project contained the directories: (bib bin cfg data fig src todo). When I use git subtree split -P bib -b export git checkout export I get a the bib directory, plus all files that should have been ignored or considered binary based on .gitignore such as the src directory and everything in it that ends in a tilde or the ./data directory. dwickrama@DWwork:~/research/trunk$ ls * -r biblography.bib JabRef src: script1.sh~ README~ script2.sh~ script3.sh~ script4.R~ script5.awk~ script5.py~ cfg: cfgFile1.ini~ cfgFile2.ini~ cfgFile3.ini~ bin: bigBinaryPackage1 bigBinaryPackage2 dwickrama@DWwork:~/research/trunk$ My .gitignore file is as follows: *.doc diff=word *.tex diff=tex *.bib diff=bibtex *.py diff=python *.eps binary *.jpg binary *.png binary ./bin/* binary *~ How do I prevent this?

    Read the article

  • Git - git add in a gitignore directory

    - by Steve
    If my .gitignore file has tmp\ in it and I do a git add file.test from tmp, Git adds file.test to the repository. If file.test never changes, than this is as good as a one time add to the repository, right? Say for static files that I want to be in version control. You want the file in an initial clone and that's it. I assume file.test doesn't get tracked, so if there are updates, Git doesn't see it as modified?

    Read the article

  • Confusing .gitignore syntax

    - by tmslnz
    I was reading http://www.kernel.org/pub/software/scm/git/docs/gitignore.html and the 6 points used to explain the ignore patterns seem to be describing a custom variant of a glob search syntax. I am more familiar with Mercurial, which allows to explicitly ignore via glob or regex patterns, no questions asked. Is there anything similar functionality in Git? Can anyone point me to some more exhaustive reference than the Git man page? Best, t

    Read the article

  • Is there a way to tell git-status to ignore the effects of .gitignore files?

    - by meowsqueak
    I have configured numerous .gitignore files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do 'git add .' when I've got my filtered list looking the way I want it. But, then I want to disable the .gitignore filters temporarily to see what got left behind, and make sure there was nothing important accidentally filtered. I know that git-clean includes an option to ignore .gitignore files - is there a similar option for git-status? I could go through and delete all the .gitignore files, do the check, then restore them, but it seems there should be an easier way?

    Read the article

  • How do negated patterns work in .gitignore?

    - by chrisperkins
    I am attempting to use a .gitignore file with negated patterns (lines starting with !), but it's not working the way I expect. As a minimal example, I have the folllowing directory structure: C:/gittest -- .gitignore -- aaa/ -- bbb/ -- file.txt -- ccc/ -- otherfile.txt and in my gitignore file, I have this: aaa/ !aaa/ccc/ My understanding (based on this: http://ftp.sunet.se/pub//Linux/kernel.org/software/scm/git/docs/gitignore.html) is that the file aaa/ccc/otherfile.txt should not be ignored, but in fact git is ignoring everything under aaa. Am I misunderstanding this sentence: "An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again."? BTW, this is on Windows with msysgit 1.7.0.2.

    Read the article

  • git status shows a file that I have listed explicitly in my .gitignore file

    - by metaperl
    I have the following line in my .gitignore file: var/www/docs/.backroom/billing_info/inv.pl but when I type 'git status' I am told the following: # modified: var/www/docs/.backroom/billing_info/inv.pl I dont understand how a file which is explicitly listed as an ignore pattern could be listed as modified when I want git to ignore it. There are no lines starting with a ! in my .gitignore file Here is my entire .gitignore file for reference: http://pastebin.com/Jw445Qd7

    Read the article

  • .gitignore, hidden file

    - by Tonja
    I have some problems with the hidden files. I can see a file in cmd (it is a .gitignore file), but I cannot see it when I open it normally in a folder. I have changed alredy an option to see all hidden files. And I cannot see it as well in a git command prompt. What should I do to be able to see it? Thanks. PS. I can see it normally in a folder BUT it has no name. When I click on this file's settings it shows me: Datatype: Textdocument(.gitignore) Is it normal`?

    Read the article

  • What .gitignore I should use with QT projects? (QT Creator)

    - by Envek
    So, after little thinking I have wrote the following: # In repository we don't need to have: # Compiled object files *.o # Generated MOC, resource and UI files moc_*.cpp qrc_*.cpp ui_*.h # Built windows .exe and linux binaries # NOTE: PROJECT is a your project's name, analog of PROJECT.exe in Linux *.exe *.dll PROJECT # Windows-specific files Thumbs.db desktop.ini # Editors temporary files *~ # Debug and Release directories (created under Windows, not Linux) Debug/ Release/ Please ask, what needs to be added or fixed (especially for Windows - I haven't one under hand now. And Mac too [haven't work in it at all]). I want to keep my repository clear :-)

    Read the article

  • .gitignore not working for me

    - by John Grey
    Hi, I'm trying to create a new git repository from existing folder. I've created a .gitignore file in the root of the folder. But if I say 'git add *' 'git commit' 'git push' files that should be ignored still get commited to the remote repository. I'm on Windows. Also I've bought a license for SmartGIT. It also seems to ignore .gitignore. I have to manually select which new files to commit. What am I doing wrong?

    Read the article

  • What are some cool git or .gitignore tricks & best practices? [closed]

    - by 01walid
    Git is just awesome and fast VCS, however, knowing better this tool will help you incredibly increase your productivity and save your time. Here we can try to make a collection of tips, tricks and useful links to better take advantage of git, this question can have some more sub-questions, I mean: what are some usefull commands that reverse or rectify commits/adding/removing mistakes? what are .gitignore & Global .gitignore best practices? especially with private/secure files that contains passwords, api keys, local config and so on ... .gitignore first or git add <files> first? what are the advantages/disadvantages of both being the first/last. links to blog post, articles, would be sufficient. I thought every sub-question is not worthy opening a whole post each alone, I think centralizing these tips in one question post would help many people.

    Read the article

  • .gitignore for Visual Studio Projects and Solutions

    - by Martin Aatmaa
    Which files should I include in .gitignore when using Git in conjunction with Visual Studio Solutions (.sln) and Projects? Community Wiki: #OS junk files Thumbs.db *.DS_Store #Visual Studio files *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *.vssscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.cache *.ilk *.log *.lib *.sbr *.sdf ipch/ obj/ [Bb]in [Dd]ebug*/ [Rr]elease*/ #Tooling _ReSharper*/ [Tt]est[Rr]esult* #Project files [Bb]uild/

    Read the article

  • Git ignore sub folders

    - by Marcel
    I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein. .gitignore with "bin/" ignores "Debug" and "Release" folders, but also any dll's contained in the "bin" folder. "bin/Debug" or "bin/Release" in the .gitignore file does not exclude the directories, unless I fully qualify the ignore pattern as "Solution/Project/bin/Debug" - which I don't want to do as I will need to include this full pattern for each project in my solution, as well as add it for any new projects added. Any suggestions?

    Read the article

  • Can I version dotfiles within a project without merging their history into the main line?

    - by istrasci
    I'm sure this title is fairly obscure. I'm wondering if there is some way in git to tell it that you want a certain file to use different versions of a file when moving between branches, but to overall be .gitignored from the repository. Here's my scenario: I've got a Flash Builder project (for a Flex app) that I control with git. Flex apps in Flash Builder projects create three files: .actionScriptProperties, .flexProperties, and .project. These files contain lots of local file system references (source folders, output folders, etc.), so naturally we .gitignore them from our repo. Today, I wanted to use a new library in my project, so I made a separate git branch called lib, removed the old version of the library and put in the new one. Unfortunately, this Flex library information gets stored in one of those three dot files (not sure which offhand). So when I had to switch back to the first branch (master) earlier, I was getting compile errors because master was now linked to the new library (which basically negated why I made lib in the first place). So I'm wondering if there's any way for me to continue to .gitignore these files (so my other developers don't get them), but tell git that I want it to use some kind of local "branch version" so I can locally use different versions of the files for different branches.

    Read the article

  • Multiple Git repositories in one directory

    - by Jakob
    Hello, I would like to deploy a directory to multiple developers having different permissions. So this is one thing Git cannot do. What about creating two repositories in one directory and assigning them different file lists by excluding files managed by the other repository with the .gitignore file. Example: /www/project/.git for all files execpt in /www/project/css /www/project/css/.git - only files in this directory Has anyone tried this solution? Or are there any better ways to handle this issue? Regards, Jakob

    Read the article

  • git: ignore everything except subdirectory

    - by Michael Goerz
    I want to ignore all files in my repository except those that occur in the 'bin' subdirectory. I tried adding the following to my .gitignore * !bin/* This does not have the desired effect, however: I created a new file inside of bin/, but doing 'git status' still "shows nothing to commit (working directory clean)" Any suggestions? Thanks, Michael

    Read the article

  • Protect Files from Git

    - by Tanner
    I'm using Git with WindRiver to manage a project of mine. The code is being managed, however the project files (such as .cproject, .project, .wrmakefile, and .wrproject) are not. However when I switch branches, Git deletes those files spite them being in .gitignore, thereby removing my ability to compile the code without having to revert commits or keeping a backup. So, is there a way to say to Git - ignore these files and don't touch them no matter what?

    Read the article

  • How can you indicate files to ignore in svn when using git and the git-svn bridge?

    - by Tchalvak
    There is a master subversion repository that I've cloned a git repo from. I've got a lot of ignored files in my .gitignore that I'd like the svn repository to know about. I know that I can use git svn show-ignored to pull the ignored list from subversion, but how can I do the reverse? Send a list of files to be ignored back to the svn repo? Git version (and git-svn is at the same version): git --version git version 1.7.0.5

    Read the article

  • Git ignore all folders apart from

    - by digital
    I want to ignore all the files in my folder structure apart from the following conditions: profiles (and all folders/files recursive) sites/xxx (and all folders/files recursive) Currently my gitignore file looks like: `*` !sites/xxx !sites/xxx/modules !sites/xxx/modules/* !profiles !profiles/xxx !profiles/xxx/* This doesn't allow me to track sites/xxx/modules/new though, is there anyway round this.

    Read the article

  • How to permanently prevent specific part of a file from being committed in git?

    - by boutta
    I have cloned a remote SVN repository with git-svn. I have modified a pom.xml file in this cloned repo in a way that the code compiles. This setup is exclusive for me. Thus I don't want to push the changes back on the remote repo. Is there a way to prevent this (partial) change of a file from being committed into the repo? I'm aware of the fact, that I could use a personal branch, but this would mean certain merging overhead. Are there other ways? I've looked into this question and this one, but they are for rather temporal changes. Update: I'm also aware of the .gitignore possibilities, but this would mean to exclude the file completely.

    Read the article

  • Using Git to work with subversion: Ignoring modifications to tracked files

    - by Chris Nicola
    I am currently working with a subversion repository but I am using git to work locally on my machine. It makes work much easier, but it also makes some of the bad behavior going on in the subversion repo quite glaring and that creates problems for me. There is a somewhat complex local build process after pulling down the code and it creates (and unfortunately modifies) a number of files. Obviously these changes are not meant to be committed back to the repository. Unfortunately the build process is actually modifying some tracked files (yes, most likely because someone mistakenly committed these build artifacts at some point to the subversion repository). Since these are modifications adding them to my ignore file does nothing for me. I can avoid checking these changes back it, I simple don't stage or commit them, but having unstaged local changes means I can't rebase without first cleaning them up. What I would like to know is if there any way to ignore future changes to a set of tracked files? Alternatively, is there another way to handle the problem I am having, or will I just have to tell whoever checked in these files to clean them up?

    Read the article

1 2 3  | Next Page >