devel@ where you _can_ ask
 help / color / mirror / Atom feed
* [newbies] git pull into subdirectory
@ 2025-11-11 18:36 Alexander Lubyagin
  2025-11-12  5:25 ` Anton Farygin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexander Lubyagin @ 2025-11-11 18:36 UTC (permalink / raw)
  To: devel-newbies

Добрый день.

Возник такой вопрос.

Во многих репозиториях Альта принят принцип - хранить исходники в 
подкаталоге %name/%name/

Как оформить первый коммит, чтобы из удалённого репозитория свежие 
коммиты подтягивались сразу в подкаталог по git fetch?

Вручную, у меня получилось так, для пакета mdless (markdown viewer in Ruby):

  cd mdless
  git init -b master .
  git remote add upstream https://github.com/ttscoff/mdless
  git remote -v
  git fetch upstream
  git merge -s ours --no-commit upstream/develop
  git read-tree --prefix=mdless -u upstream/develop
  git commit -m "Subtree merged in mdless/"
  git remote add local /opt/gk/man/mdless
  git remote -v
  git push --set-upstream local master
  ls -l mdless/
  git ls-files | less

--

Однако, таким способом получается дублирующийся список файлов: в ./ и в 
./mdless/

Я искал другие способы. Из найденных:
[1] Использование git subtree
[2] Использование git sparse checkout
[3] Использование git worktree
[4] Использование submodule
[5] Переименование файлов + filter-branch: 
https://stackoverflow.com/a/4042965

Какой из вариантов наиболее правильный?
Я пробовал смотреть в имеющихся пакетах, но, бывает, changelog длиннее, 
чем git log.

Или, всё же, правильный вариант - с gear-uupdate? 
https://www.altlinux.org/Gear/gear-uupdate

--



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-12 17:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-11 18:36 [newbies] git pull into subdirectory Alexander Lubyagin
2025-11-12  5:25 ` Anton Farygin
2025-11-12 15:07   ` shad
2025-11-12 17:13     ` Anton Farygin
2025-11-12  7:49 ` Alexander Lubyagin
2025-11-12 16:58 ` Paul Wolneykien
2025-11-12 17:46   ` Mikhail Efremov

devel@ where you _can_ ask

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-newbies/0 devel-newbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-newbies devel-newbies/ http://lore.altlinux.org/devel-newbies \
		devel-newbies@lists.altlinux.org devel-newbies@lists.altlinux.ru devel-newbies@lists.altlinux.com
	public-inbox-index devel-newbies

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-newbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git