Skip to content

Instantly share code, notes, and snippets.

View hugoltsp's full-sized avatar
😃
I may be slow to respond.

Hugo Leonardo Teles hugoltsp

😃
I may be slow to respond.
View GitHub Profile
@hugoltsp
hugoltsp / gist:b10533929978db4fca18ec46687d8f9d
Last active November 20, 2019 15:57
Changes url of a git repository
git remote set-url origin git://new.url.here
git remote add origin git@github.com:myrepo
@hugoltsp
hugoltsp / current git branch on bash
Last active November 16, 2019 12:20
Highlights the current branch when navigating through a git repository in bash
#add the following to the .bashrc file
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$(parse_git_branch)\$ '