Sometimes I hate springboot for different kind of hidden things. You just copy sample with dozens different annotations and then...
GitLab and GitHub synchronization
Andriy AndrunevchynWe use GitLab as our version control system. Due to specific customer requirements periodically we should push latest changes to GitHub account. So if you should do the same just follow this instruction
- Assign alias for remote GitHub account
git remote add MyRemoteGitAccountAlias https://yourLogin@github.com/yourLogin/yourRepoName.git
- Pull latest changes
git pull
- Push all changes to remote GitHub account
git push --mirror MyRemoteGitAccountAlias
Pay attention you will push all branches and tags so perhaps you would like to remove all local branches except required one. You could do this with the following command.
Linux
Remove all except trunk
git branch | grep -v "trunk" | xargs git branch -D
Remove all except dev and trunk
git branch | grep -v "trunk\|dev" | xargs git branch -D
Remove all merged except trunk
git branch --merged master | grep -v "trunk" | xargs git branch -D
Windows (run PowerShell)
git branch | Select-String -NotMatch -Pattern "trunk" | %{ git branch -D $_.ToString().Trim() }
P.S.
If you would like just remove outdated branches which were already removed on remote but still are present locally then you could execute
git fetch --prune