top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Is there an API to the .gitignore capability?

0 votes
383 views

.gitignore is a flexible way to customize what dir/file to search or not to search. So it is of general use and is more flexible than what is offered by "find". I'm wondering if there is an API than I can use besides using it within git.

posted Jun 2, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Git provides no C API, if that's what you mean. You can link with libgit.a, but there's no guarantee it won't break someday. At a higher "API" level such as shell scripting, still "no", but I think you could modify "git ls-files" to support running 'ls-files -i' without a git repository (like git-grep --no-index). I think it'll work, mostly, but not entirely sure.

answer Jun 3, 2013 by anonymous
Similar Questions
+3 votes

Does someone know where the files after a "git rm" go? Some of my files where deleted by git, of course I have no copy, I tried several file recovery utilities, but so far none of them see the deleting files.

I am running Windows 7; git 1.9.4; gitextension 2.48.03

Full story:
One week ago I created a new repository from an old CVS server. I checked it out from scratch (clone it), into CLONE, and copy the .git folder into a folder, MyFolder, containing some changes that were not pushed under CVS. So far everything ran fine, I could pushed the new changes.

However, MyFolder contained also a a folder called Perso with some files I did not want to push. Therefore I added Perso/* into .gitignore. Then the folder Perso disappeared as potential commit. So far so good. Then I don't really remember what I've done, maybe clean some branches? but yesterday I remarked that Perso/ was no more on the disk.

Currently there is no stash, no other branches. I tried a menu (under GitExtensions) "Repository/Git Maintenance/Recover lost objects" with option "print out objects that exists but that aren't readable from any of the reference nodes"... without success. I suppose git removed my files when switching the branch? Hence my question, is there a change I could get these files back? I am afraid they are lost... what a silly situation.

+1 vote

I have a large Git project which I would like to dissect into subprojects with their own repositories. Git subtrees are ideal for this task: I first

  • create a branch with the contents of only one subfoldergit subtree split -P -b

and then

  • pull this branch into another repository.

For a transitional phase, I would like to have the subprojects read-only and sync them from master. The question is how to organize this. For every commit to master, I could of course perform the above procedure repeatedly for all subprojects, but this seems less then ideal since it does all the work all over again.

Is there a way to merge master into the subtree branches?

0 votes

There are shorthands for going back from HEAD, but not for the initial commit, AFAICT.

I often want to do this when rebasing, and have come to tagging the initial commit in my repos with INITIAL.

Is there a better syntax I'm missing?

+5 votes

I know form the "git log" we can now the commit time, but how to know when it is in the remote git server.

0 votes

I am new to GIT world.I would like to know which third party provider (e.g Bitbucket, Gitlab, Github) provides more API resources?
thank you in advance.

...