Added automatic detectiom of branch on sync.sh script