makandracards.com

git branch -d the_local_branch delete a local branch git push origin --delete the_remote_branch [remove_the_local_branch] remove a remote branch alternatively, git push origin :the...

Use git reflog to find the SHA1 of commit of the branch. From that point, you can recreate a branch using: git branch branchName...

space next log entries q

git clone -b mybranch --single-branch http://repo.com/repo.git

Sean Feldman's deck
stackoverflow.com

git add -A stages All git add . stages new and modified, without deleted git add -u stages modified and deleted, without new

Sean Feldman's deck

git log --pretty=oneline

Sean Feldman's deck

git commit --allow-empty

Sean Feldman's deck

git clean -xdf

See all blobs and commits that are not committed git fsck --lost-found Look at the content of a dangling blob by SHA git show blob_sha Restore into a...

git show SHA1 > temp.file OPTIONAL Force clean-up and compact

git log --graph --oneline Prettier: git log --graph --oneline --decorate

git branch

Best results in other decks

...pushed when saying git push. Our recommendation is to set it to current. From the git-config documentation: push.default Defines the action git push should take if no refspec is...

...check your setting, do the following. By default, it will return matching (see above). $ git config --global push.default matching So to change that to push only current branches, just go...

makandra dev

git checkout is the swiss army of git commands. If you prefer a semantically more meaningful command for restoring tasks, use git restore instead. With this command you...

Info For this use case you can also use git checkout. Sources Git - git-restore Documentation Also see Git commands to discard changes Git restore vs reset

Search in all decks