-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
505b65c
commit 1309c14
Showing
36 changed files
with
193 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.13.2017 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.13.2017 | ||
# | ||
# ADDING FILES | ||
# | ||
# Adds files in order to commit and shows git status | ||
# git add | ||
|
||
git add $* && \ | ||
clear && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.13.2017 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.13.2017 | ||
# | ||
# ADDING ALL FILES | ||
# | ||
# Adds all files in order to commit and shows git status | ||
# git add --all | ||
|
||
git add --all && \ | ||
clear && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.16.2017 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.16.2017 | ||
# | ||
# CHECKOUT FILES | ||
# | ||
# Checkout files and shows git status | ||
# git checkout -- | ||
|
||
git checkout -- $* && \ | ||
clear && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 07.05.2016 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 07.05.2016 | ||
# | ||
# BRANCH CHACKOUT | ||
# | ||
# It forces the checkout of a branch | ||
# git checkout --track origin/<current_branch_name> | ||
|
||
branch_name=$1 | ||
branch_name="$1" | ||
git checkout --track origin/$branch_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 11.28.2017 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 11.28.2017 | ||
# | ||
# GIT DIFF | ||
# | ||
# Show changes of a file and suggests to add it | ||
# git diff | ||
|
||
clear | ||
|
||
if [ "$1" = "" ] | ||
then | ||
if [ "$1" = "" ]; then | ||
git diff | ||
return | ||
fi | ||
|
@@ -20,8 +17,7 @@ git diff "$1" | |
echo "" | ||
read -p " Add this file to commit? [y/N]: " r | ||
|
||
if [ "$r" = "y" ] | ||
then | ||
if [ "$r" = "y" ]; then | ||
git add "$1" | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.21.2018 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.21.2018 | ||
# | ||
# ADD, COMMIT, PUSH | ||
# | ||
# A shortcut for a common sequence in order to push changes | ||
# git add --all | ||
# git commit -m <message> | ||
# git push origin <current_branch_name> | ||
|
||
branch=$(git branch | grep -oP '(?<=\* ).*') | ||
msg=$1 | ||
branch_name=$(git branch | grep -oP '(?<=\* ).*') | ||
msg="$1" | ||
|
||
git add --all && \ | ||
git commit -m "$1" && \ | ||
git push origin $branch | ||
git commit -m "$msg" && \ | ||
git push origin $branch_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 09.01.2016 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 09.01.2016 | ||
# | ||
# GIT LOG | ||
# | ||
# Perform a pretty git log | ||
# It performs a pretty git log. | ||
|
||
logCmd="git log --date=short --pretty=format:'%C(bold yellow)%h%C(reset) %C(white)%ad %C(bold blue)(%ar)%C(reset) %C(bold green)%an %C(reset)%C(cyan)%s%C(reset)'" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.01.2016 | ||
# | ||
# git pull | ||
|
||
. ~/.fancy-git/random_messages.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.01.2016 | ||
# | ||
# git pull origin <branch_name> | ||
|
||
. ~/.fancy-git/random_messages.sh | ||
|
||
run() { | ||
local branch | ||
branch="$1" | ||
local branch_name | ||
branch_name="$1" | ||
|
||
git pull origin $branch | ||
git pull origin $branch_name | ||
|
||
_fancygit_after_pulling_random_message | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.01.2016 | ||
# | ||
# git pull origin <current_branch_name> | ||
|
||
. ~/.fancy-git/random_messages.sh | ||
|
||
run() { | ||
local branch | ||
branch=$(git branch | grep -oP '(?<=\* ).*') | ||
local branch_name | ||
branch_name=$(git branch | grep -oP '(?<=\* ).*') | ||
|
||
git pull origin $branch | ||
git pull origin $branch_name | ||
|
||
_fancygit_after_pulling_random_message | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.01.2016 | ||
# | ||
# git push origin <current_branch_name> | ||
|
||
branch=$(git branch | grep -oP '(?<=\* ).*') | ||
branch_name=$(git branch | grep -oP '(?<=\* ).*') | ||
|
||
git push origin $branch | ||
git push origin $branch_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 05.24.2016 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 05.24.2016 | ||
# | ||
# BRANCH RENAMING | ||
# It renames a branch locally. | ||
# | ||
# Rename branch locally | ||
# git branch -m <new_branch_name> | ||
|
||
new_branch_name=$1 | ||
new_branch_name="$1" | ||
|
||
git branch -m $new_branch_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 05.24.2016 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 05.24.2016 | ||
# | ||
# BRANCH RENAMING | ||
# Rename branch locally. | ||
# Delete the old branch. | ||
# Push the new branch, set local branch to track the new remote branch. | ||
# | ||
# Rename branch locally | ||
# Delete the old branch | ||
# Push the new branch, set local branch to track the new remote | ||
# git branch -m <new_branch_name> | ||
# git push origin :<old_branch_name> | ||
# git push origin <new_branch_name> | ||
|
||
new_branch_name=$1 | ||
new_branch_name="$1" | ||
old_branch_name=$(git branch | grep -oP '(?<=\* ).*') | ||
|
||
git branch -m $new_branch_name | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.19.2018 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.19.2018 | ||
# | ||
# APPLY STASH | ||
# | ||
# It applies a stash | ||
# git stash apply stash@{<stash_id>} | ||
|
||
stash_id=$1 | ||
stash_id="$1" | ||
git stash apply stash@{$stash_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.19.2018 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.19.2018 | ||
# | ||
# DROP STASH | ||
# | ||
# It drops a stash | ||
# git stash drop stash@{<stash_id>} | ||
|
||
stash_id=$1 | ||
stash_id="$1" | ||
git stash drop stash@{$stash_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.19.2018 | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 04.19.2018 | ||
# | ||
# SHOW STASH CHANGES | ||
# | ||
# It shows a stash changes | ||
# git stash show stash@{<stash_id>} | ||
|
||
stash_id=$1 | ||
stash_id="$1" | ||
git stash show stash@{$stash_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/bin/bash | ||
|
||
gurl=$(git config --list | grep -oE 'https://.*|git@.*') | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.04.2016 | ||
# | ||
# git remote -v | ||
|
||
echo "" | ||
echo " $gurl" | ||
git remote -v | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.18.2016 | ||
# | ||
# It shows the user name and email. | ||
|
||
guser=$(git config --list | grep -oP '(?<=user.name=).*') | ||
gemail=$(git config --list | grep -oP '(?<=user.email=).*') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 03.02.2016 | ||
# | ||
# Commands manager. | ||
|
||
. ~/.fancy-git/version.sh | ||
|
||
|
@@ -19,8 +24,7 @@ fg_update() { | |
|
||
current_date=$(date +%Y-%m-%d) | ||
|
||
if [ ! -f ~/.fancy-git/last_update_at ] | ||
then | ||
if [ ! -f ~/.fancy-git/last_update_at ]; then | ||
touch -f ~/.fancy-git/last_update_at | ||
fi | ||
|
||
|
@@ -69,25 +73,21 @@ fg_update_checker() { | |
current_date=$(date +%Y-%m-%d) | ||
last_update_at=$(cat ~/.fancy-git/last_update_at) | ||
|
||
if [ ! -f ~/.fancy-git/last_update_at ] | ||
then | ||
if [ ! -f ~/.fancy-git/last_update_at ]; then | ||
touch -f ~/.fancy-git/last_update_at | ||
fi | ||
|
||
if [ "$manual_update" = "yes" ] | ||
then | ||
if [ "$manual_update" = "yes" ]; then | ||
fg_update | ||
return | ||
fi | ||
|
||
if [ "$current_date" = "$last_update_at" ] | ||
then | ||
if [ "$current_date" = "$last_update_at" ]; then | ||
return | ||
fi | ||
|
||
branch_name=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') | ||
if [ "$branch_name" = "" ] | ||
then | ||
if [ "$branch_name" = "" ]; then | ||
return | ||
fi | ||
|
||
|
@@ -97,15 +97,13 @@ fg_update_checker() { | |
updates=$(cd ~/.fancy-git && git diff origin/master) | ||
option="n" | ||
|
||
if [ "$updates" != "" ] | ||
then | ||
if [ "$updates" != "" ]; then | ||
echo "" | ||
echo " Hey! A new Fancy Git update has been released!" | ||
read -p " Would you like to update it? [Y/n]: " option | ||
fi | ||
|
||
if [ "$option" = "y" ] | ||
then | ||
if [ "$option" = "y" ]; then | ||
echo "" | ||
fg_update | ||
fi | ||
|
@@ -114,7 +112,7 @@ fg_update_checker() { | |
cd "$current_dir" || return | ||
} | ||
|
||
case $1 in | ||
case "$1" in | ||
"-h"|"--help") fg_script_help;; | ||
"-v"|"--version") fg_show_version;; | ||
"update") fg_update_checker;; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
#!/bin/bash | ||
# | ||
# Author: Diogo Alexsander Cavilha <[email protected]> | ||
# Date: 06.06.2018 | ||
# | ||
# Configuration file. | ||
|
||
# ASCII | ||
local separator | ||
local branch_icon | ||
|
Oops, something went wrong.