Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git - pushing branch descriptions to remote

Tags:

git

Once a week we have integration meetings where we review code in branches not merged in to master. As a starting point we use this to list open branches

git branch -a --no-merged master

We name our branches after ticket numbers so it tough to see what we are really looking at. I get back

BUG_1231231
BUG_1412434
FEATURE_1231231
FEATURE_1232244

I know I can add and view descriptions by running
git branch --edit-description BUG_1231231
git config branch.BUG_1231231

The issue is these descriptions seemed to be stored in the config of my local repository. Can these descriptions be pushed to the remote?

like image 666
personalt Avatar asked Jun 12 '12 13:06

personalt


People also ask

How do I push changes from local branch to remote branch?

Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.

What does push branch to remote mean?

Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches. Remote branches are configured using the git remote command.

How do I add a description to a git branch?

Branch description, can be edited with git branch --edit-description . Branch description is automatically added in the format-patch cover letter or request-pull summary.

How do I specify which branch to push to?

Push Branch to Another Branch In some cases, you may want to push your changes to another branch on the remote repository. In order to push your branch to another remote branch, use the “git push” command and specify the remote name, the name of your local branch as the name of the remote branch.


2 Answers

Considering the description is stored in the config file (here, the local one, within your Git repo), then, no, branch descriptions aren't pushed.

Config files are not pushed (ever). See "Is it possible to clone git config from remote location?"

Simple text files are, though, as my initial answer for branch description recommended at the time.

Branch descriptions are all about helping make an helpful message for publishing.
Not for copying that message over the other repos which won't have to publish the same information/commits.

Using branch.$name.description as the configuration key, give users a place to write about what the purpose of the branch is and things like that, so that various subsystems, e.g. "push -s", "request-pull", and "format-patch --cover-letter", can later be taught to use this information.


Update 2020 (8 years later):

philb mentions in the comments the issue gitgitgadget/git 438 about "Branch descriptions should be versionable".
philb adds:

If this is ever implemented, branch descriptions would be stored in refs and could then be pushed to a remote.

like image 187
VonC Avatar answered Oct 17 '22 22:10

VonC


This seems like a fairly recent git feature and may not be well supported yet. Take a look at the README feature, Branch descriptions in git

like image 1
gjcamann Avatar answered Oct 17 '22 21:10

gjcamann