Notes On Git
After tagging some source code with the wrong email address!!! its time to make some git notes
Config
For every repository:
git config --global user.email "email@example.com"For single repository:
git config user.email "email@example.com"See https://help.github.com/articles/setting-your-commit-email-address-in-git/
Branches
Create a new branch
git branch branch-name
List branches
git branchCheckout new branch
git checkout branch-namePush new branch to repo
git push -u origin branch-nameSet remote branch example
git push --set-upstream origin add-sources-and-sinksMerge back into main
git branch master
git merge branch-nameList merged branches
git branch --mergedRemove old branches
git branch -d old-branch ;local branch removalUnused or unmerged branches
git branch --no-mergedSee git housekeeping
Tags
Create a tag on a specific commit
List the commits
git log --pretty=oneline
8547a37a91c6d0a22606ae9b4be8afee6cb5893f Initial commit
fa437248eb9fc555283b688ce258bc0d3e0987ff Fixed up to serve the js and index pages from the default routeTag on the current branch at the latest commit
git tag v1.1.1
Or tag a specific commit on the branch that a commit occurred using the sha
git tag -a v0.0.1 8547a37a91c6d0a22606ae9b4be8afee6cb5893f -m"Works with cljs-react-material-ui"Or a specific branch
git tag v1.0 other-branch-name
Delete
get tag -d v0.0.1Share a tag to bitbucket
git push origin v0.0.1Or for a lot of tags
git push origin --tagsShow files under a tag
git show --name-only <tagname>-->tag v0.0.1
Tagger: pm <dev@softwarebynumbers.com>
Date: Thu Nov 22 08:59:43 2018 +0000Works with cljs-react-material-uicommit 8547a37a91c6d0a22606ae9b4be8afee6cb5893f
Author: pm <dev@softwarebynumbers.com>
Date: Thu Nov 22 08:35:38 2018 +0000 Initial commit resources/public/index.html
src/cljs/sa/screens/core.cljs
src/cljs/sa/screens/login/login_screen.cljs
src/cljs/sa/screens/mui_themes.cljsCommit History
git log --pretty=onelineAdding Files
git add -u add all updated