aboutsummaryrefslogtreecommitdiffstats
path: root/_examples/config/main.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-04-18 14:01:19 +0200
committerGitHub <noreply@github.com>2020-04-18 14:01:19 +0200
commit53f87846a196c856e00fe825bc5f29551b2ea524 (patch)
tree7e3b41c053f207f7d54f32739e7f4c87d322ce9e /_examples/config/main.go
parentbb3a1bfcc62224001d577b933355661259b80854 (diff)
parent9437ff56b4903ccbb1f91a61e6a121b71cfdf047 (diff)
downloadgo-git-53f87846a196c856e00fe825bc5f29551b2ea524.tar.gz
Merge pull request #31 from lcostea/liviu/add_save_config_changes
examples: config, Show how to save config changes
Diffstat (limited to '_examples/config/main.go')
-rw-r--r--_examples/config/main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/_examples/config/main.go b/_examples/config/main.go
index 6ccc9f6..7c5592f 100644
--- a/_examples/config/main.go
+++ b/_examples/config/main.go
@@ -58,6 +58,10 @@ func main() {
// Get custom config param (merged in the same way git does: system -> global -> local)
Info("custom.name is %s", cfg.Merged.Section("custom").Option("name"))
+ //In order to save the config file, you need to call SetConfig
+ //After calling this go to .git/config and see the custom.name added and the changes to the remote
+ r.Storer.SetConfig(cfg)
+
// Get system config params (/etc/gitconfig)
systemSections := cfg.Merged.SystemConfig().Sections
for _, ss := range systemSections {