Skip to content

Instantly share code, notes, and snippets.

View jgeewax's full-sized avatar
🤯
Learning

JJ Geewax jgeewax

🤯
Learning
View GitHub Profile
(environment)(dashboard)(master)jj@im-jj:~/workspace/dashboard/src$ git branch test
(environment)(dashboard)(master)jj@im-jj:~/workspace/dashboard/src$ git checkout test
Switched to branch 'test'
(environment)(dashboard)(test)jj@im-jj:~/workspace/dashboard/src$
function jumpto {
if [ -z "$1" ]; then
deactivate 2>/dev/null
cd $HOME
return 0
fi
local DIRECTORY=$HOME/workspace/$1/src
if [ -d $DIRECTORY ]; then
jj@im-jj:~$ jumpto dashboard
(environment)(dashboard)(master)jj@im-jj:~/workspace/dashboard/src$ jumpto reportingdb
(environment)(reportingdb)(master)jj@im-jj:~/workspace/reportingdb/src$ jumpto
jj@im-jj:~$
_jumpto() {
local IFS=$'\t\n'
local dirs=("$HOME/workspace/")
COMPREPLY=( $(
for dir in "${dirs}"; do
cd "$dir" 2 >/dev/null &&
compgen -d -- "${COMP_WORDS[COMP_CWORD]}"
done
) )
(master)jj@im-jj:~/demo$ git checkout -b issue-12
Switched to a new branch 'issue-12'
(issue-12)jj@im-jj:~/demo$
(issue-12)jj@im-jj:~/demo$ echo "print 'hi'" >> feature.py
(issue-12)jj@im-jj:~/demo$ git add feature.py
(issue-12)jj@im-jj:~/demo$ git commit -m "Added feature"
[issue-12 765a6c0] Added feature
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 feature.py
(issue-12)jj@im-jj:~/demo$ git rm README.txt
rm 'README.txt'
(issue-12)jj@im-jj:~/demo$ git commit -m "Removed the README file"
[issue-12 e7829cb] Removed the README file
(issue-12)jj@im-jj:~/demo$ git diff master
(issue-12)jj@im-jj:~/demo$ git rebase -i master
pick 765a6c0 Added feature
pick e7829cb Removed the README file
pick f9753df Added testfile.txt
pick 4e39fc7 Updated feature
# Rebase 309291d..4e39fc7 onto 309291d
#
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
pick 765a6c0 Added feature
s e7829cb Removed the README file
s f9753df Added testfile.txt
s 4e39fc7 Updated feature
# Rebase 309291d..4e39fc7 onto 309291d
#
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending