diff --git a/base/src/macports1.0/macports.tcl b/base/src/macports1.0/macports.tcl
index c42e1c4..c38bb3f 100644
--- a/base/src/macports1.0/macports.tcl
+++ b/base/src/macports1.0/macports.tcl
@@ -1896,7 +1896,31 @@ proc mportsync {{optionslist {}}} {
         switch -regexp -- [macports::getprotocol $source] {
             {^file$} {
                 set portdir [macports::getportdir $source]
-                if {[file exists $portdir/.svn]} {
+                if {[file exists $portdir/../.git]} {
+                    set git_commandline "cd ${portdir}; [macports::findBinary git] pull"
+                    ui_debug $git_commandline
+                    if {
+                        [catch {
+                            if {[getuid] == 0} {
+                                set euid [geteuid]
+                                set egid [getegid]
+                                ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
+                                setegid [name_to_gid [file attributes $portdir -group]]
+                                seteuid [name_to_uid [file attributes $portdir -owner]]
+                            }
+                            system $git_commandline
+                            if {[getuid] == 0} {
+                                seteuid $euid
+                                setegid $egid
+                            }
+                        }]
+                    } {
+                        ui_debug "$::errorInfo"
+                        ui_error "Synchronization of the local ports tree failed doing an svn update"
+                        incr numfailed
+                        continue
+                    }
+                } elseif {[file exists $portdir/.svn]} {
                     set svn_commandline "[macports::findBinary svn] update --non-interactive ${portdir}"
                     ui_debug $svn_commandline
                     if {
