Reputation: 1554
I am looking for a stenciled workflow solution, not a one time solution for this issue.
Not looking to create new branches on Master A as solution, please. I would like to keep Master A organic for others to pull and benefit with no clutter/branches.
Thanks,
Buddy
Upvotes: 0
Views: 38
Reputation: 1914
To reproduce your scenario I created two repositories testgitA
and testgitB
.
testgitA
contains some commits as well as some new uncommitted changes, whereas testgitB
is empty.
Now, for "B to include all the new and uncommitted written code from A + Include all commits of A", I'd follow these steps:
Duplicate the folder testgitA
into a new folder testgitB
.
cp -R testgitA/ testgitB/
Note: This is to catch the uncommitted code.
Go into testgitB
and change the url of remote origin to new one.
cd testgitB/
git config remote.origin.url "https://github.com/Udayraj123/testgitB"
Now you commit your changes into testgitB
, where testgitA
remains unaffected.
git add . && git commit -m "into testgitB"
If you want to discard uncommitted changes in the boilerplate repo, use the following command.
cd ../testgitA
git add .
git stash
Ref: More ways to discard uncommitted changes here
Upvotes: 1