Recipes and such for Git source management system.
man gittutorial
man giteverday
man git
man gitcli
People approach Git with different needs. I believe it is very important to keep this is mind when helping others learn it. Three fundamental differences for me are as follows:
--patch
flag should be top of the git manual”kaar One big downside with using tools like GitHub and GitLab
is that a lot of information about the code is getting
lost in PullRequest/MergeRequest. Information that should go into you commit messages. GitHub/GitLab issues and prs and comments are lost and hard to migrate
Tasks I want to upgrade:
man git
tig
git status
git log [-p]
git show <commit>
git diff [--cached]
git tag
git ls-remote --tags
git add . (current dir only)
git add -A . (current dir and all subdirs recursively)
git tag -d <tag>
git push origin -d <tag>
I staged and need to undo it:
git reset -p .
git ls-remote --tags | pae 's,.+/,,'
Some repos have no business being on GitHub or GitLab, but using the
same workflow is nice. I prefer to not even keep this anywhere near my
$REPOS
directory with everything else.
cd # to get home
mkdir priv
cd priv
git init
git init --bare /media/rwxrob/06CF-482C/priv.git
git remote add bak /media/rwxrob/06CF-482C/priv.git
git push --set-upstream bak master
And can clone it with the pull path.
git clone /media/rwxrob/06CF-482C/priv.git
git diff --cached
WARNING: git diff
(for me) is utterly useless. Using --cached
shows
exactly what is staged (when git diff
without it will show nothing.
git rebase -i --root
git commit --amend
Careful on this one. N
is how far back.
git rebase -i HEAD~N
git branch -d <name>
git push origin --delete <name>
git branch -m master main
git push -u origin main
git config --global init.defaultBranch main
git push origin :branch-to-delete
This works because the colon separates <from>:<to>
and an empty from
blows away the destination.
git push mirror # omg, i juse blew away all local branches
git push origin :branch-to-delete # deletes remote branch