8000 Merge pull request #31 from lcostea/liviu/add_save_config_changes · go-git/go-git@53f8784 · GitHub
[go: up one dir, main page]

Skip to content

Commit 53f8784

Browse files
authored
Merge pull request #31 from lcostea/liviu/add_save_config_changes
examples: config, Show how to save config changes
2 parents bb3a1bf + 9437ff5 commit 53f8784

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

_examples/config/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ func main() {
5858
// Get custom config param (merged in the same way git does: system -> global -> local)
5959
Info("custom.name is %s", cfg.Merged.Section("custom").Option("name"))
6060

61+
//In order to save the config file, you need to call SetConfig
62+
//After calling this go to .git/config and see the custom.name added and the changes to the remote
63+
r.Storer.SetConfig(cfg)
64+
6165
// Get system config params (/etc/gitconfig)
6266
systemSections := cfg.Merged.SystemConfig().Sections
6367
for _, ss := range systemSections {

0 commit comments

Comments
 (0)
0