Posts

Showing posts with the label Git

Git - moving commits from one project to another using patches

Do this in the source project (you want to move): git format-patch <hash_fist_commit> HEAD -o <folder_where_all_pathces_will_be_saved> Do this in the destination project (which you want new changes should appear): <folder_where_new_changes_should_appear>  -->      - ->  it can be the folder with another project in the monorepo project structure git am --directory= <folder_where_new_changes_should_appear>  --commit  <folder_with_patches>/<patch_file .patch > Attention : If you had errors like file still in index or file still in working tree your steps are: git rm --cached <file_name> rm <file_name> P.S.: before doing any manipulations like I described, you should make a back_up_copy of your repository. Author doesn't take any responsibility for your repo damage. Happy coding🤗

Git tips, tricks and some explanations

Image
Git tips, tricks and some explanations Полезные встроенные графические инструменты (для винды): gitk - Графический просмотрщик для коммитов git gui - Чё-то наподобие среды для GIT (ну GUI есть гуй :-) Создаём Псевдонимы: $ git config --global alias. ch checkout $ git config --global alias. br branch $ git config --global alias. co commit $ git config --global alias. st status $ git config --global alias. visual '!gitk'  Пример использования: $ git st Чтобы создать ветку и сразу же перейти на неё, вы можете выполнить команду: $ git checkout -b имя_ветки Допустим, вы разобрались с проблемой  hotfix   и готовы объединить эту ветку и свой master . Чтобы сделать это, мы сольём ветку имя_ветки в ветку master . Всё, что вам нужно сделать, — перейти на ту ветку, в которую вы хотите слить свои изменения, и выполнить команду git merge : $ git checkout master (переход в master) $ git merge имя_ветки (сливание[объединение]) Вы можете удалить ветку с по

Переименование или перемещение папок(директорий) в git

Image
Переименование или перемещение папок(директорий), лучше делать командой и правильно: git mv [(source)источник] [(destination)получатель] https://stackoverflow.com/questions/14578680/changing-case-of-folder-via-git-bash-on-windows  т.к.   я уже спотыкался на этом и под виндой было больно )) она ведь не различает CAPS (маленькие и большие буквы) Перемещение файлов в гит (дока) а вот так можно сделать винду CASE сенсетив, т.е. чуствительной к регистру   и к WSL

Обновление GIT, команда для Windows

Image
$ git update Warning! `git update` has been deprecated; Please use `git update-git-for-windows` instead.

Сравнение размеров репозиториев (Git & Others)

Сравнение размеров репозиториев (Git & Others)