|
|
On Sat, 23 Oct 2021 19:17:07 -0400, Cousin Ricky wrote:
> There is something I don't understand about Git branches.
>
> I have some projects that have been on my hard disk for years, but have
> just recently converted to Git repositories. I want to start a branch
> on one of them. My understanding is that Git tracks changes in both the
> main/master branch and the new branch. But I only have one working copy
> of the actual files in my directory. Which branch do these files
> represent, and where are the files of the other branch? How does this
> all work?
The only change tracking is on the active branch. If you're working
outside of master, no changes you make are recorded in master unless you
either do a cherry pick or a merge - in either case, at the point of the
merge or cherry pick, the changes you've made (or selected, in the case
of a cherry pick) are brought into the target branch (can be master, can
be some other branch).
In git, you're only ever working in a single branch, ever.
--
"I learned long ago, never to wrestle with a pig. You get dirty, and
besides, the pig likes it." - George Bernard Shaw
Post a reply to this message
|
|