tech:notes_git_svn
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_git_svn [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_git_svn [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes git svn | ||
| + | |||
| + | Voir : | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | |||
| + | ## Config | ||
| + | |||
| + | Source : http:// | ||
| + | |||
| + | ~~~bash | ||
| + | git svn init -s http:// | ||
| + | ~~~ | ||
| + | |||
| + | Changer | ||
| + | |||
| + | `.git/ | ||
| + | ~~~ini | ||
| + | [svn-remote " | ||
| + | url = svn:// | ||
| + | fetch = monprojet/ | ||
| + | branches = monprojet/ | ||
| + | tags = monprojet/ | ||
| + | ~~~ | ||
| + | |||
| + | En | ||
| + | |||
| + | `.git/ | ||
| + | ~~~ini | ||
| + | [svn-remote " | ||
| + | url = svn:// | ||
| + | fetch = trunk: | ||
| + | branches = branches/ | ||
| + | tags = tags/ | ||
| + | ~~~ | ||
| + | |||
| + | Récupération | ||
| + | ~~~bash | ||
| + | git svn fetch | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Utilisation | ||
| + | |||
| + | Commande locales normales (add, commit) | ||
| + | ~~~bash | ||
| + | git commit -a -m "* test" | ||
| + | ~~~ | ||
| + | |||
| + | Push sur SVN | ||
| + | ~~~bash | ||
| + | git svn fetch | ||
| + | git svn rebase --dry-run | ||
| + | git svn rebase | ||
| + | git svn dcommit | ||
| + | ~~~ | ||
| + | |||
| + | Push sur git (si utilisation en parallèle d'un dépôt git) | ||
| + | ~~~bash | ||
| + | git pull | ||
| + | git push | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Exemple - fichier .git/config | ||
| + | |||
| + | |||
| + | `.git/ | ||
| + | ~~~ini | ||
| + | [core] | ||
| + | repositoryformatversion = 0 | ||
| + | filemode = true | ||
| + | bare = false | ||
| + | logallrefupdates = true | ||
| + | |||
| + | [svn-remote " | ||
| + | url = svn:// | ||
| + | fetch = trunk: | ||
| + | branches = branches/ | ||
| + | tags = tags/ | ||
| + | |||
| + | [remote " | ||
| + | url = ssh:// | ||
| + | fetch = +refs/ | ||
| + | |||
| + | [branch " | ||
| + | remote = origin | ||
| + | merge = refs/ | ||
| + | |||
| + | ~~~ | ||
| + | ## Migration | ||
| + | |||
| + | Voir https:// | ||
| + | |||
| + | Source : https:// | ||
| + | |||
| + | Clone du dépôt subversion | ||
| + | ~~~bash | ||
| + | git svn clone svn:// | ||
| + | ~~~ | ||
| + | |||
| + | The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a " | ||
| + | |||
| + | Anytime, you want to run the equivalent of \\ | ||
| + | `svn update`, do a `git svn rebase` | ||
| + | |||
| + | . This will fetch new commits which were checked into SVN after you last synchronised and then rebase your changes onto the new tip. | ||
| + | |||
| + | When you're ready with your commits, do a git `svn dcommit`. | ||
| + | This will send all your new commits to svn one by one. You can also squash your local commits into a single one and send it by first doing a local rebase and then an svn dcommit. | ||
| + | This should be done on the initial branch (usually master). | ||
| + | |||
| + | The very fact that you're checking out from subversion and then working locally in git means that there is " | ||
| + | |||
