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
1
vote
1 answer

Git id not showing any conflicts for binary files

We are checking in binary files into git. The problem is git does not shows conflicts/changes while merging. It just accepts the file and overwrites it even there are conflicts. I am not sure whether git understands binary files or not. Please help…
1
vote
2 answers

Git plumbing: export tree at commit without touching HEAD/index

I'm writing a program that needs to concurrently extract different commits from the same repository (like in this question, but concurrently). Porcelain commands such as git checkout and git archive operate on the index, thus any time a commit would…
Vladimir Panteleev
  • 24,651
  • 6
  • 70
  • 114
1
vote
1 answer

git: Best way to determine unmerged branches in a script

At an interactive prompt, I can use the git branch -r --no-merged command to determine remote branches that haven't been merged yet. However, git branch is a porcelain command and therefore is not suitable for use in a script. Is there any good…
user2221343
  • 614
  • 5
  • 16
1
vote
1 answer

Git Directory Permissions Always 000

By messing around with Git objects, I've found that the tree entries within a tree object always have these permissions. 040000 DirEntry hash The 04 means that it is a directory, but the permissions are 000. Does this mean that Git does not store…
ThePyroEagle
  • 153
  • 12
1
vote
2 answers

Git Commit Object Author and Commiter Fields

I am trying to make a server using Java that runs on a Linux machine and I would like my server to support Git in a similar fashion to GitHub. I have figured out a lot of things to achieve this but there is one thing I would like to know... Assuming…
ThePyroEagle
  • 153
  • 12
0
votes
1 answer

What Does `--contains` Option Do in `git for-each-ref`?

What does the --contains option do in git for-each-ref? Does it only return a reference if its revlist has the commit specified after the --contains option on the command line? (e.g. Does git for-each-ref refs/heads --contains feature/test only…
adam.hendry
  • 4,458
  • 5
  • 24
  • 51
0
votes
1 answer

Remove only on Local any Remote branch no longer include in fetch

for example, I have the following Branches: main -> tracking origin/main feature/f1 -> tracking origin/feature/f1 feature/f2 -> tracking origin/feature/f2 and in .gitconfig [ remote "origin"] url = ... fetch =…
NexCastus
  • 23
  • 1
0
votes
4 answers

How to exclude files in Git while disregarding .gitignore?

Background I'm migrating a VCS to git. This is done by checking out from the old VCS (TFSVC) and checking into a git repository via scripts. Essentially in such a loop: for x in $(seq 1 100) do tf get $x # get version x git add . # add…
CervEd
  • 3,306
  • 28
  • 25
0
votes
1 answer

Access reflog subject with git rev-list (or any other plumbing command)

I'd like to access reflog subjects with a plumbing command. I'd expect: $ git rev-list --format='%gs' --walk-reflogs HEAD to give me what I want, but this just gives me output like: commit f1cb402488661fb3662ad876e98fcce991677333 commit…
alecbz
  • 6,292
  • 4
  • 30
  • 50
0
votes
0 answers

Is it possible to get a depth first object ordering from git rev-list?

I can almost get a depth first ordering with git rev-list --in-commit-order --objects --reverse HEAD which gives me something like commit A tree AA blob A blob B commit B tree BA ... When I want blob B blob A tree AA commit A ... Post processing…
k00b
  • 38
  • 1
  • 5
0
votes
1 answer

What is the complete list of location where git objects are stored on disk?

I have a git repo and I am trying to find where on disk a particular commit is stored. git show shows the commit. git cat-file -p shows the commit in raw form. The commit is not under .git/objects/. The commit is not under…
Unapiedra
  • 15,037
  • 12
  • 64
  • 93
0
votes
1 answer

Chaining git clean (Porcelain) command

I was trying to perform git clean for some untracked files. I typed the following, unintentionally right, command: git clean -dn | grep -v | git clean -df Note that the line seems to be missing a xargs. That is, I'd have normally…
joker
  • 3,416
  • 2
  • 34
  • 37
0
votes
1 answer

git merge multiple commits into one in an orphan branch each commit in a prefix subdirectory

I need a merge more than 1 commit each from a branch or a remote repo into a single commit in another branch. input branch#1: o--o- - -o (C1) \ input branch#2: o--o- - -o | (C2) : \| input…
Andry
  • 2,273
  • 29
  • 28
0
votes
1 answer

Detect a commit diff/patch/hunk in another branch similar to the way cherry-pick does

Using git, I would like to check which, if any, of the diffs from a specific commit have been applied (and where) to a specific branch. cherry-pick does this (except for the "where" part) when you cherry pick a commit and only applies the diffs…
MikeJansen
  • 3,336
  • 3
  • 26
  • 37
0
votes
1 answer

Grep all the same name files' properties across all the git branches using pipelines

I have a git repo of configuration files segregated by branches, e.g.: refs/heads/branch1, file - settings.properties refs/heads/branch2, file - settings.properties etc. I'm trying to grep certain property of every each of the settings.properties…
maxi
  • 369
  • 5
  • 14