Skip to content

Instantly share code, notes, and snippets.

@CharaD7
Last active July 10, 2024 13:09
Show Gist options
  • Save CharaD7/a03e53a890a2a8ee6b12ef45bf21f1d8 to your computer and use it in GitHub Desktop.
Save CharaD7/a03e53a890a2a8ee6b12ef45bf21f1d8 to your computer and use it in GitHub Desktop.
Git config settings for alx students
[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 = user_email@doamin.com
[core]
ignorecase = false
[init]
defaultBranch = main
@RamadanDY
Copy link

good resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment