[cctbxbb] Making branches by accident

markus.gerstel at diamond.ac.uk markus.gerstel at diamond.ac.uk
Thu Dec 8 00:14:26 PST 2016


I use a custom prompt so I can see what is going on when I am in a git repository folder.

This is the code one could add to their ~/.bashrc:
https://gist.github.com/Anthchirp/dfc9a4382f8dfc9a97fe1039c9e6789a

This is what it looks like:
https://postimg.org/image/8c9h72qwd/

This is what happens in the image:
* yellow brackets indicate you are in git territory, and contain the current branch name
* red branch name = uncommitted changes in repository
* positive number: number of commits the local repository is ahead of the remote repository
* the 'git pull' command causes an implicit merge commit, which I undo with the next command
* negative number: number of commits the local repository is behind the remote repository
* both negative and positive number: branches have diverged

Maybe someone finds it useful.

-Markus


________________________________
From: cctbxbb-bounces at phenix-online.org [cctbxbb-bounces at phenix-online.org] on behalf of Pavel Afonine [pafonine at lbl.gov]
Sent: Wednesday, December 07, 2016 18:24
To: cctbxbb at phenix-online.org
Subject: Re: [cctbxbb] Making branches by accident

This happened to me a few times now, and just double-checked that my .gitconfig contains "rebase = true". Let's see if it happens again..
Pavel

On 12/7/16 00:02, Graeme.Winter at diamond.ac.uk<mailto:Graeme.Winter at diamond.ac.uk> wrote:
Morning all

I am seeing a certain amount of “Merge branch 'master' of github.com:cctbx/cctbx_project” coming through on the commits – this usually means you did not do a git pull –rebase before the git push. This can be set to the default by using the spell Markus sent out

git config --global pull.rebase true

This will need to be done on each machine you push from, else getting the habit of doing a git pull –rebase before push is a good one.

We have had this on and off with DIALS but it tends to pass easily enough.

What bad happens? Nothing really but the history becomes confusing…

So:  may be worth checking that you have the pull.rebase thing set?

Cheerio Graeme



--

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom




_______________________________________________
cctbxbb mailing list
cctbxbb at phenix-online.org<mailto:cctbxbb at phenix-online.org>
http://phenix-online.org/mailman/listinfo/cctbxbb





More information about the cctbxbb mailing list