Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Git '--progress' flag is for and how to use it

Today I have noticed in my IDE (IntelliJ) that when I do 'commit and push' from the IDE level I can see in the version control output tab that IntelliJ is using the following command:

git push --progress origin storyBranchA:storyBranchA

I wonder how I can use that 'progress' flag outside of my IDE, is there any nice usage explained somewhere as I cannot find anything about that flag, and why the IDE is actually specifying the branch to commit to as storyBranchA:storyBranchA and not simply

git push --progress origin storyBranchA

Regards Kris

like image 737
Kris Avatar asked Aug 08 '13 09:08

Kris


People also ask

What is the use of flag in git?

By using the -a flag when committing you are telling Git to add all files that have been modified and then commit them.

What is the use of git status command?

The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git.

How do you see what files will be pushed git?

In Git, we can use git show commit_id --name-only to list all the committed files that are going to push to the remote repository.


1 Answers

The man page for git push seems to have documented the flag:

--progress

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal.

Since IntelliJ is not launching the program under a terminal, it’s asking Git to report the progress anyway.

The reason for specifying both the local and remote refspec on the git push command line is that they never optimized for the case when both sides are the same. storyBranchA is equivalent to storyBranchA:storyBranchA. It is possible to have the branch named one way locally, and another way remotely. In that case, you'd see something like storyBranchA:someOtherRef on the command line.

You also don't want to just use git push blindly because their settings may have git push setup to push all tracking branches, rather than the single branch that was intended.

like image 187
John Szakmeister Avatar answered Sep 30 '22 01:09

John Szakmeister