Skip to content

Commit

Permalink
Fix local default branch logic for "git sync"
Browse files Browse the repository at this point in the history
Fixed wrong local default branch. The default branch of a Git installation can be different than the default branch of the "origin" repository. E.g. repo: "master", local git: "main"
  • Loading branch information
Measurity authored Sep 29, 2023
1 parent 46bc9f8 commit 7ca5069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/contributors/development-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ get_local_active_branch() {
git branch --show
}

# Sourced from: https://stackoverflow.com/a/44750379
get_local_default_branch() {
git config --get init.defaultBranch
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
}

# Sourced from: https://stackoverflow.com/a/61357104/1277156
Expand Down

0 comments on commit 7ca5069

Please sign in to comment.