On 7/13/2019 1:37 PM, Philip Oakley wrote:
On 12/07/2019 12:58, CrestChristopher wrote:
Is it possible to take snippets of code along while also including a
description of what the code is intended to do and push it to a git,
so I have a repository of code snippets,
It can be done. However there are a few issues regarding 'alignment'
between the classic Git (take a snapshot of working files) approach
and your desire to also have 'context'.
What do you mean ?
since I know git is for version control as I tend to like to have
code snippets for reference ?
Valid points.
Also can you push files within a git to another git; for example,
push a repository or the files in the repository from github to
another git ?
No, not directly. One pushes the whole commit and it's ancestors to
the destination repo, so it is not selective. However if you have
resolved how you record the context then it's not a real problem.
What do you mean, resolved how you record the context ?
One option is to add each code snippet as a distinct snippet file
(maybe under a 'snippets' director?); Then add each snippet
individually and commit that snippet with a message that has your
"description of what the code is intended to do", and a Subject that
is "filename: short one-line summary". Then when you 'git log' that
snippets branch (oneline version) you get your 'catalog' of snippets
and can select as appropriate.
Git is normally incrementally additive while a snippet data base
considers each part as discrete, so one has to manage that difference.
Philip
I'm currently using github, although I want to run my own private git
that is turning out to be a problem getting a kernel updated.
I don't understand what you mean by the last part ?
--
You received this message because you are subscribed to the Google Groups "Git for
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/git-users/dea0a2af-ff00-4991-e89f-997a25b8a1ec%40gmail.com.
For more options, visit https://groups.google.com/d/optout.