On 06/23/2010 05:16 PM, Eric Cooper wrote:
I maintain both the upstream and Debian version of a program in a git
repo, using "upstream" and "master" branches, git-buildpackage, etc.

Occasionally I forget which branch I'm on and commit upstream changes
to the master branch by mistake.

Is there a way to tell git that when I'm on the master branch, I
should only be allowed to commit files in the debian/ subdirectory?


Perhaps a .gitignore file of something like:

*
!debian/

and maybe a bright red git branch listed on your $PS1, maybe:

mshu...@gaea:~$ cd src/repos/git/haproxy/
(master)mshu...@gaea:~/src/repos/git/haproxy$ grep -iC3 git ~/.bashrc
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
# adapted from http://people.planetpostgresql.org/dfetter/index.php?/archives/53-Git-+-bash-win.html
    if [ -f /etc/bash_completion.d/git ]; then
        PSGIT='\[\033[01;31m\]$(__git_ps1 "(%s)")\[\033[00m\]'
        PS1="$PSGIT$PS1"
    fi
fi

--
Kind regards,
Michael


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4c22ac3e.5070...@pbandjelly.org

Reply via email to