Git Initial Configuration
ENG
Setting up a Git repository
ATTENTION: Projects on Unreal Engine with multiple small source files and content files are extremely sensitive to disk speed.
It is crucial to set up the repository on an SSD! Order and install at least a 1TB SSD for yourself. If you plan to work with different versions of UE, or checkout various branches into separate repositories, or if you are an artist with an art repository, then order a 2TB SSD.
And if the project is already on an HDD, do not hesitate to take the time to transfer it to an SSD. Otherwise, your work will turn into a nightmare.
Installing Git
If the script Scripts/InstallVS.bat has already been launched, then you need to go straight to the Git Setup item
You can download it here: https://git-scm.com/download
For the most part, everything is default everywhere. The most important thing is to make sure that:
- Git LFS (Large File Support) - on 2nd screen
- Use the OpenSSL library - on the 5th screen
- Checkout Windows-style, commit Unix-style line endings - on the 6th screen
- Use Windows' default console window - on the 7th screen
Next, the same thing in pictures (Points may change, but relatively important ones are marked with arrows):
Setting up Git
Create file %USERPROFILE%\.ssh\config and write in it the line "AddressFamily inet" without quotes.
Execute in cmd.exe:
git lfs install
git config --global pull.rebase true
git config --global user.name <your domain name without angle brackets>git config --global user.email <your corporate email without angle brackets>
Example:
Keep in mind that user name IS NOT your windows name. You can check it here https://git.at.dev-my.games/-/user_settings/profile in the field Full Name
Setting up GitLab
To work, you need to configure an ssh key, for this:
Start → Git GUI → Help → Show SSH Key → Generate Key (DO NOT set passphrase, it interferes with git-lfs' normal operation. Just press OK 2 times)
Copy the resulting key and add it to the page https://git.at.dev-my.games/-/profile/keys (login/password domain)
- Set some alias for the key and click Add key
Downloading the repository
- Check that there is access to the repository - it should open https://git.at.dev-my.games/sprw/sprw
- Go to the folder you intend to use for work
Run command in console
git clone git@git.at.dev-my.games:sprw/sprw.git sprw
where sprw is the name of the directory that will be created and where the contents of the repository will be downloaded
- To work with the repository it is convenient to use a GUI client, for example you can Git Extensions or Tortoise Git
Local hooks (for programmers)
To enable local hooks (currently only supporting automatic formatting of C++ code), you need to run the setup_repo.sh script once, located in the root of the repository.
If there is not enough disk space
See on the project download pageRUS
Настройка Git репозитория
ВНИМАНИЕ: проекты на Unreal Engine с кучей мелких исходников и контентных файлов крайне чувствительны к скорости работы с диском.
Очень важно поставить репозиторий на SSD! Заказывайте и ставьте себе минимум 1ТБ SSD. Если вы предполагаете работать с разными версиями UE. или выкачивать какие-то ветки в отдельные репозитории, или вы художник и у вас ещё есть и артовый репозиторий, то заказывайте 2ТБ.
А если проект уже лежит на HDD, не пожалейте времени и переставьте на SSD. Иначе ваша работа будет превращена в ад.
Установка Git
Если уже был запущен скрипт Scripts/InstallVS.bat, то нужно перейти сразу же к пункту Настройка Git
Скачать можно тут: https://git-scm.com/download
По большей части везде всё по умолчанию. Из важного, убедиться что выставлены:
- Git LFS (Large File Support) - на 2-м экране
- Use the OpenSSL library - на 5-м экране
- Checkout Windows-style, commit Unix-style line endings - на 6-м экране
- Use Windows' default console window - на 7-м экране
Далее тоже самое в картинках (Пункту могут меняться, но относительно важные отмечены стрелочками):
Настройка Git
Создать файл %USERPROFILE%\.ssh\config и написать в него строчку "AddressFamily inet" без кавычек.
Выполнить в cmd.exe:
git lfs install
git config --global pull.rebase true
git config --global user.name <ваше доменное имя без угловых скобок>git config --global user.email <ваша корпоративная почта без угловых скобок>
Настройка GitLab
Для работы необходимо настроить ssh ключ, для этого:
Пуск → Git GUI → Help → Show SSH Key → Generate Key (passphrase НЕ задавать, он мешает нормальной работе git-lfs)
Скопировать получившийся ключ и добавить его на странице https://git.at.dev-my.games/-/profile/keys (логин/пароль доменные)
- Задать какой-то алиас для ключа и нажать Add key
Скачивание репозитория
- Проверить, что есть доступ к репозиторию - должен открываться https://git.at.dev-my.games/sprw/sprw
- Перейти в папку, которую предполагается использовать для работы
Выполнить команду в консоли
git clone git@git.at.dev-my.games:sprw/sprw.git sprw
где sprw - название директории, которая создастся и куда выкачается содержимое репозитория
- Для работы с репозиторием удобно использовать GUI клиент, например можно Git Extensions или Tortoise Git
Локальные хуки (для программистов)
Чтобы включить локальные хуки (в данный момент поддерживается только автоматическое форматирование С++-кода), нужно один раз запустить скрипт setup_repo.sh, который находится в корне репозитория.











