Last active
July 10, 2024 13:09
-
-
Save CharaD7/a03e53a890a2a8ee6b12ef45bf21f1d8 to your computer and use it in GitHub Desktop.
Git config settings for alx students
This file contains hidden or 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
[alias] | |
i = init | |
f = fetch | |
pr = fetch origin +refs/pull/*/head:refs/remotes/origin/pr/* | |
cl = clone | |
rao = remote add origin | |
rso = remote set-url origin | |
acm = "!f() { git add . && git commit -m \"$(echo $@)\"; }; f"; | |
c = checkout | |
con = checkout main | |
cob = checkout -b | |
b = branch | |
br = branch -r | |
# Display current reomte connections | |
r = remote -v | |
# Delete branches. | |
# -d for normal delete, -D for forced delete | |
# Example g bd branch_name OR g bD branch_name | |
bd = branch -d | |
bD = branch -D | |
p = push | |
pl = pull | |
pa = pull -all | |
pon = push origin main | |
plon = pull origin main | |
s = status | |
# Undo a `git push` | |
undopush = push -f origin HEAD^:main; | |
# merge | |
mn = merge main | |
m = merge | |
# Undo merge | |
undomerge = reset --hard HEAD@{1}; | |
# Undo changes not commited | |
undo = reset --hard; | |
# Undo last commit and remove from stage | |
# Example | |
# git unstage file1 file2 ... | |
unstage = reset HEAD -- #file; | |
[user] | |
name = user_name | |
email = [email protected] | |
[core] | |
ignorecase = false | |
[init] | |
defaultBranch = main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good resource