-
Notifications
You must be signed in to change notification settings - Fork 14
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
Showing
1 changed file
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# ---------------- git worflows ---------------- # | ||
|
||
# Keep your GitHub forked repo in sync with the original repository with master as the primary branch | ||
function fetchremotems() { | ||
git fetch upstream && | ||
git merge upstream/master && | ||
git push origin master | ||
} | ||
|
||
# Keep your GitHub forked repo in sync with the original repository with main as the primary branch | ||
function fetchremotemn() { | ||
git fetch upstream && | ||
git merge upstream/main && | ||
git push origin main | ||
} | ||
|
||
# create new branch and checkout to it | ||
function gcb() { | ||
git checkout -b "${1}" | ||
} | ||
|
||
# checkout to a branch | ||
function gc() { | ||
git checkout "${1}" | ||
} | ||
|
||
# push changes to another branch | ||
function gbp() { | ||
git push origin "${1}" | ||
} | ||
|
||
# add, commit, push changes to github | ||
function gacp() { | ||
git add . && | ||
git commit -m "${1}" && | ||
git push | ||
} | ||
|
||
# aliases | ||
alias gi='git init' | ||
alias gs='git status' | ||
alias gaa='git add .' | ||
alias gc='git commit -m ' | ||
alias gp='git push' | ||
alias gpm='git push origin master' |