tag (git)

archive

ignoring files generated by eclipse for git Oct
18
1
1

If you're developing in Eclipse, like I am for Android, and you use version control you're going to want to ignore the default project files that are generated by Eclipse. You should update your .gitignore with the following list:

.project
.classpath
.settings/
bin/

comments

delete a remote branch in git Jul
21
1
1

It's not always clear how to delete a remote branch in git, but it's just the following command:

git push REMOTENAME :BRANCHNAME

 The syntax is a little wonky if you're not used to the advanced push syntax. If you look at the details of what's happening you're telling git to push nothing into the remote branch.

git push REMOTENAME LOCALBRANCHNAME:REMOTEBRANCHNAME

comments

globally config git color Apr
06
1
1

git config --global color.ui true

comments

git-aware ps1 Nov
19
1
0

http://blog.bitfluent.com/post/27983389/git-utilities-you-cant-live-without

You'll need git-completion.bash working, but put the following line into your .bashrc or .bash_profile to display the current branch in your terminal.

PS1='$(__git_ps1 "(%s)")$ '

Which you can combine with whatever you already have setup. It can be something similar to one of the following:

PS1='\h:\W$(__git_ps1 "(%s)") \u\$ '
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\ $(__git_ps1 "(%s)")$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "(%s)")$ '

comments

setting the default editor for git commit messages Apr
07
1
0

Here's how you can set the default editor when commenting on git commits.

From man git-commit:

Environment And Configuration Variables

The editor used to edit the commit log message will be chosen from the GIT_EDITOR environment variable,
the core.editor configuration variable,
the VISUAL environment variable,
or the EDITOR environment variable (in that order).

examples:

git config --global core.editor "vim"
export VISUAL=vim
export EDITOR=vim

The EDITOR has the advantage that a number of other programs use this setting.

comments