mysite
└── application
├── backend
└── frontend
└── .git
git filter-repo --to-subdirectory-filter application/frontend
mysite
└── application
├── backend
└── frontend
├── .git
└── application
└── frontend
git init
# добавить в .gitirnore /config/db.php
git add . # загнать остальные файлы под отслеживание
git commit
git remote add origin https://github.com/..........
# на рабочем компьютере удалить db.php из репозитория
# и никогда больше добавлять такие вещи в репо
git pull origin master # влить изменения с компа
# на этом этапе скорее всего вылезут конфликты
# сможете их разрешить прямо на сервере?
а можно ли сделать так, чтобы при git clone папка /vendor на локалку сливалась, после чего убедить git перестать ее отслеживать?
git rm -r --cached -- 'vendor/*'
git commit
git reset --soft github/master
git commit -с
git push github -all
# 1 -> 2
git rebase --onto master tmp1~2 tmp1 # пересадить два коммита ветки tmp1
git rebase --onto master tmp2~3 tmp2 # пересадить три коммита ветки tmp2
git reset HEAD~1 # обрезать ветку tmp2 на один коммит
# 1 -> 3
git rebase --onto master tmp1~3 tmp1# пересадить три коммита ветки tmp1
git switch master # вернуться в мастер
git reset tmp1~2 # и подвинуть его на шаг вперёд
git rebase --onto master tmp2~3 tmp2 # пересадить три коммита ветки tmp2
git update-index --assume-unchanged файл
# create a repository interactively
gh repo create
# create a new remote repository and clone it locally
gh repo create my-project --public --clone
# create a remote repository from the current directory
gh repo create my-project --private --source=. --remote=upstream
# create a repository under your account using the current directory name
$ glab repo create
# create a repository under a group using the current directory name
$ glab repo create --group glab-cli
# create a repository with a specific name
$ glab repo create my-project
# create a repository for a group
$ glab repo create glab-cli/my-project
Грубо говоря на компе [папка1], а в репе лежит [папка1, папка2]
git reset --hard HEAD^
git push --force
A - B - C - - - - J [master]
\
D - E - F - G [branch-A]
\
H - - I [branch-B]
diff -u <(git rev-list --first-parent child_branch) <(git rev-list --first-parent parent_branch) | sed -ne 's/^ //p' | head -1
git reset --hard example/ветка
git reset --hard
git checkout '*'
git restore '*'
git clean -d -f