Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shorten output of 'git pull' command?

  • So I ran $ git pull command on a git repository.
  • And it outputs useful details that I am interested in, and a lot of other details that I don't care about.
  • So is there some switch or option to leave only the details I need?

$ git pull

I need this information:

remote: Enumerating objects: 2866, done.
remote: Counting objects: 100% (2866/2866), done.
remote: Total 4840 (delta 2865), reused 2865 (delta 2865), pack-reused 1974
Receiving objects: 100% (4840/4840), 7.51 MiB | 2.98 MiB/s, done.
Resolving deltas: 100% (3810/3810), completed with 531 local objects.
From https://github.com/erlang/otp
   76da23bb4e..6053c0e4d7  master     -> origin/master
   77cff66931..39968f062e  maint      -> origin/maint
   934f9974eb..f30b1052c7  maint-21   -> origin/maint-21
 * [new tag]               OTP-21.2.6 -> OTP-21.2.6
 * [new tag]               OTP-20.3.2.1 -> OTP-20.3.2.1
Updating 76da23bb4e..6053c0e4d7

I don't need this information:

Fast-forward
 .gitignore                                         |     3 +
 bootstrap/bin/no_dot_erlang.boot                   |   Bin 6539 -> 6541 bytes
 bootstrap/bin/start.boot                           |   Bin 6539 -> 6541 bytes
 bootstrap/bin/start_clean.boot                     |   Bin 6539 -> 6541 bytes
 bootstrap/lib/compiler/ebin/beam_a.beam            |   Bin 3364 -> 3200 bytes
 bootstrap/lib/compiler/ebin/beam_asm.beam          |   Bin 11040 -> 10996 bytes
 bootstrap/lib/compiler/ebin/beam_block.beam        |   Bin 3460 -> 3444 bytes
 bootstrap/lib/compiler/ebin/beam_disasm.beam       |   Bin 20864 -> 20860 bytes
 bootstrap/lib/compiler/ebin/beam_except.beam       |   Bin 4252 -> 4228 bytes
 bootstrap/lib/compiler/ebin/beam_jump.beam         |   Bin 10024 -> 9988 bytes
 .../lib/compiler/ebin/beam_kernel_to_ssa.beam      |   Bin 29484 -> 28880 bytes
 bootstrap/lib/compiler/ebin/beam_peep.beam         |   Bin 3644 -> 3604 bytes
 bootstrap/lib/compiler/ebin/beam_ssa.beam          |   Bin 12208 -> 12176 bytes
 bootstrap/lib/compiler/ebin/beam_ssa_bsm.beam      |   Bin 18176 -> 17952 bytes
 bootstrap/lib/compiler/ebin/beam_ssa_codegen.beam  |   Bin 37824 -> 37708 bytes
 bootstrap/lib/compiler/ebin/beam_ssa_dead.beam     |   Bin 12128 -> 11876 bytes
 bootstrap/lib/compiler/ebin/beam_ssa_lint.beam     |   Bin 7512 -> 7536 bytes
 etc...

So how do I do this?

like image 461
bxq Avatar asked Feb 25 '19 07:02

bxq


1 Answers

As a reminder, a git pull command is in fact a git fetch followed by a merge with the given (or resolved) remote-tracking branch.

The first part, useful to you, is the output of the "fetch" part of git pull. The second part, which you don't want, is the output of the ensuing fast-forward merge.

You could split operations so that you mute only the second part :

git fetch
git pull -q

Want less typing ? Do an alias

git config --global alias.qpull '!git fetch && git pull -q'

then just do

git qpull origin <someBranch>  # for "quiet pull" for example but anything goes of course
like image 165
Romain Valeri Avatar answered Sep 26 '22 18:09

Romain Valeri