origin/main
by checking the output of
git status
git 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 schannel
blog
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 status
blog
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 fetch
origin/main
into your local
main
: git merge origin/main
git 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"
main
main
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.1
v1.0
is tagged as
point release v1.0.1
and merged forward into
main
.Any workflow can be augmented with branches that track the commit that 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)
Adapt your workflow to fit how your team works and the requirements of your project
But make sure to document your workflow and the reasons for your decisions!
main
main
, make each entry in
a new branch that you then merge into main