Questions tagged [git-plumbing]

"Plumbing" commands are a set of low-level Git commands that are ideal for scripting purposes.

Git commands are generally divided into two groups:

  • "Porcelain" commands
  • "Plumbing" commands

While porcelain commands are high-level interfaces for end-users (i.e. human beings), the low-level plumbing commands are designed to be used in automated scripts. The plumbing commands are ideal for this purpose, because unlike the UI-focused porcelain commands, the plumbing commands are meant to be backwards-compatible (to avoid breaking existing scripts), while the higher-level porcelain commands have less strict API contracts that prohibit breaking-changes.

Read more in the Git manual.

54 questions
0
votes
1 answer

git (plumbing) has a file changed between two commits?

Is there a git (preferably plumbing) command to check if a file has changed between two commits? I can check this with a little grep but this does not feel like the cleanest solution: git diff --name-only HEAD HEAD~4 -- filename | grep -q…
Chris Maes
  • 35,025
  • 12
  • 111
  • 136
0
votes
0 answers

How can I get a list of files changed in a git commit?

I need a list of files (specifically regular files, not symlinks, directories, submodules, etc.) changed in a git commit. I am aware (as in e.g. this answer)that git diff-tree --name-status gives quite useful output showing a list of changed objects…
Caleb
  • 5,084
  • 1
  • 46
  • 65
0
votes
1 answer

Git: list tags and date/time for all commits in a branch

For my Python project, i need to fetch data from a git repository. At the moment i'm using: git rev-list --pretty [branch] to list all commits in the branch with date, time and commit message. But since the repository i'm working with relies on…
KevKosDev
  • 811
  • 2
  • 9
  • 31
0
votes
2 answers

How do I programmatically compare files at two revisions in git?

I want to compare two versions of a file (which exist at different paths) at different commits in git. I don't want the diff, I simply want to know if the contents and modes are the same. The documentation for diff-files doesn't indicate any…
David Greene
  • 394
  • 2
  • 12
0
votes
1 answer

Creating commit with Jgit and plumbing commands

I am trying to construct a commit with plumbing commands in JGit. Besides fetching the information, I use is basically these commands: treeFormatter.append(folderName, FileMode.TREE, treeObjectId); treeFormatter.append(fileName,…
0
votes
1 answer

How to delete first commit of a repo using github API?

I know that it is possible to do using command line (delete first git commit) But I'm not able to figure out how a similar thing can be done using github's API. Is it even possible?
Jai Pandya
  • 2,129
  • 18
  • 29
0
votes
1 answer

git refs/heads is a sub directory safe? here, or should it be somewhere else?

I have a series of branches with a prefix, I wish to reuse this prefix but not group them with the existing branches with this prefix (which are now obsolete). I Have for the time made a subdirectory in .git/refs/heads. I want to know if there are…
ThorSummoner
  • 16,657
  • 15
  • 135
  • 147
-2
votes
1 answer

How `git checkout -` works on low level

How can I get a previous branch/commit using Git plumbing commands or status files? Edit: The question is - how can I get this information (the previous branch or commit) without performing an actual checkout? This is needed for a tool which works…
Dmitry Petrov
  • 1,490
  • 1
  • 19
  • 34
-3
votes
1 answer

Git - rebase commits by an author

In a git project containing an example file named file.txt, I'd like to have a script that: Parses the current whitespace-separated word (in the example, for the first iteration, this will be Enlargement). Maybe by using a regex like \b[A-za-z+]\b…
1 2 3
4