origin/main by checking the output of
git statusgit config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global core.editor nano
git config --global init.defaultBranch main
# For Linux or macOS:
git config --global core.autocrlf input
# For Windows:
git config --global core.autocrlf true
# If you're behind a corporate proxy on Windows
git config --global http.sslBackend schannelblog repository:mkdir blog
cd blog
git init
echo "# Entry 1" > entry_1.md
git add entry_1.md
git commit -m "Add first blog entry"
git statusblog repository on GitHub, and
pushing your local repo to it:The simplest option; what we’ve been using so far:
%%{init: { 'gitGraph': {'showCommitLabel': false} } }%%
gitGraph
commit
commit
commit tag: "v1.0.0"
commit tag: "v1.0.1"
commit
commit
commit
commit tag: "v1.1.0"
You may like to add annotated tags to mark specific commits as released versions:
%%{init: { 'gitGraph': {'showCommitLabel': false, 'mainBranchName': 'origin/main'} } }%%
gitGraph
commit
commit
commit
branch main
checkout main
commit
commit
%%{init: { 'gitGraph': {'showCommitLabel': false, 'mainBranchName': 'origin/main'} } }%%
gitGraph
commit
commit
commit
branch main
checkout main
commit
commit
checkout origin/main
commit
commit
%%{init: { 'gitGraph': {'showCommitLabel': false, 'mainBranchName': 'origin/main'} } }%%
gitGraph
commit
commit
commit
branch main
checkout main
commit
commit
checkout origin/main
commit
commit
checkout main
merge origin/main
origin/main)main branchgit fetchorigin/main into your local
main: git merge origin/maingit push origin main
%%{init: { 'gitGraph': {'showCommitLabel': false} } }%%
gitGraph
commit tag: "v1.0.0"
branch 1234-add-birthday-notifications
branch 5678-fix-mobile-layout
checkout 1234-add-birthday-notifications
commit
commit
commit
checkout 5678-fix-mobile-layout
commit
checkout main
merge 5678-fix-mobile-layout tag: "v1.0.1"
checkout 1234-add-birthday-notifications
commit
commit
checkout main
merge 1234-add-birthday-notifications tag: "v1.1.0"
mainmain
main,
you will need to rebase your branch (we’ll cover that next
lesson)
%%{init: { 'gitGraph': {'showCommitLabel': false} } }%%
gitGraph
commit tag: "v1.0.0"
branch 1234-add-birthday-notifications
branch v1.0
checkout 1234-add-birthday-notifications
commit
commit
commit
checkout v1.0
commit
commit tag: "v1.0.1"
checkout main
merge v1.0
checkout 1234-add-birthday-notifications
checkout main
merge 1234-add-birthday-notifications tag: "v1.1.0"
v1.0 while working on new
features for v1.1v1.0 is tagged as
point release v1.0.1 and merged forward into
main.Instead of release tags, you might use branches to track which commit is deployed in each environment:
%%{init: { 'gitGraph': {'showCommitLabel': true, 'mainBranchName': 'origin/main'} } }%%
gitGraph
commit id: " "
commit id: " "
commit id: "prod"
commit id: " "
commit id: " "
commit id: "test"
commit id: " "
commit id: "dev"
commit id: " "
(continuous deployments could even be triggered by updates to those branches)
main
one-by-one, many feature branches are “octopus merged” to create a
release on-demandAdapt your workflow to fit how your team works and the requirements of your project
Document your workflow and reasons for decisions so that everyone understands how the team uses Git!
mainmain, make each entry in
a new branch that you then merge into main