Исходный код вики Сценарии
Версия 1.4 от Alexandr Fokin на 2022/06/15 14:20
Последние авторы
| author | version | line-number | content |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | Переместить файл или папку с сохранением истории изменений | ||
| 4 | {{code language="cmd"}}git mv <SrcFileOrDirectoryName> <DestinationDirectoryName>{{/code}} | ||
| 5 | |||
| 6 | ---- | ||
| 7 | |||
| 8 | Обновить список удаленных веток (RepositoryAlias по умолчанию: origin) | ||
| 9 | {{code language="cmd"}}git remote update <RepositoryAlias> --prune{{/code}} | ||
| 10 | |||
| 11 | ---- | ||
| 12 | |||
| 13 | Как в Git перенести commit из одной ветки в другую? | ||
| 14 | [[http:~~/~~/paratapok.ru/developer-tools/2593_kak-v-git-perenesti-commit-iz-odnoj-vetki-v-druguyu/>>http://paratapok.ru/developer-tools/2593_kak-v-git-perenesti-commit-iz-odnoj-vetki-v-druguyu/]] | ||
| 15 | {{code language="cmd"}}git cherry-pick{{/code}} | ||
| 16 | |||
| 17 | ---- | ||
| 18 | |||
| 19 | Вынесение части репозитория (отдельной папки) из конкретной ветки в другую ветку с полным сохранением ее истории. | ||
| 20 | |||
| 21 | {{code language="cmd"}} | ||
| 22 | git subtree split -P <DirectoryName> -b <NewBranchName> | ||
| 23 | {{/code}} | ||
| 24 | |||
| 25 | Detach (move) subdirectory into separate Git repository | ||
| 26 | [[https:~~/~~/stackoverflow.com/questions/359424/detach-move-subdirectory-into-separate-git-repository/17864475#17864475>>https://stackoverflow.com/questions/359424/detach-move-subdirectory-into-separate-git-repository/17864475#17864475]] | ||
| 27 | |||
| 28 | ---- | ||
| 29 | |||
| 30 | Загрузить ветку | ||
| 31 | How to download a branch with git? | ||
| 32 | [[https:~~/~~/stackoverflow.com/questions/2294313/how-to-download-a-branch-with-git>>https://stackoverflow.com/questions/2294313/how-to-download-a-branch-with-git]] | ||
| 33 | |||
| 34 | {{code language="cmd"}} | ||
| 35 | git branch --track <LocalBranchName> origin/<RemoteBranchName> | ||
| 36 | git checkout <LocalBranchName> | ||
| 37 | {{/code}} | ||
| 38 | |||
| 39 | Отправить одну определенную ветку в определенный репозиторий (в том числе в пустой) | ||
| 40 | {{code language="cmd"}}git remote add <RepositoryAlias> <RepositoryUrl> | ||
| 41 | git checkout <LocalBranchName> | ||
| 42 | git push -u <RepositoryAlias> <LocalBranchName>:<RemoteBranchName> | ||
| 43 | git remote remove <RepositoryAlias>{{/code}} | ||
| 44 | |||
| 45 | ---- | ||
| 46 | |||
| 47 |