Fake forking your own repo for maintainability purposeHow to selectively merge or pick changes from another branch in Git?Git workflow and rebase vs merge questionsHow to merge a specific commit in GitWhy does git perform fast-forward merges by default?Merge all changes from another branch as a single commitCreate a branch in Git from another branchWhat is the best (and safest) way to merge a Git branch into master?Git fetch remote branchDelete forked repo from GitHubGit merge master into feature branch
How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)
How badly should I try to prevent a user from XSSing themselves?
Zip/Tar file compressed to larger size?
Intersection Puzzle
How do I deal with an unproductive colleague in a small company?
Do UK voters know if their MP will be the Speaker of the House?
Is it inappropriate for a student to attend their mentor's dissertation defense?
ssTTsSTtRrriinInnnnNNNIiinngg
How does a predictive coding aid in lossless compression?
Unlock My Phone! February 2018
Why didn't Boeing produce its own regional jet?
How do I gain back my faith in my PhD degree?
How seriously should I take size and weight limits of hand luggage?
Can I run a new neutral wire to repair a broken circuit?
Assassin's bullet with mercury
What mechanic is there to disable a threat instead of killing it?
Why is consensus so controversial in Britain?
Should I cover my bicycle overnight while bikepacking?
What is a romance in Latin?
Can a virus destroy the BIOS of a modern computer?
Is there a hemisphere-neutral way of specifying a season?
What does “the session was packed” mean in this context?
Is it logically or scientifically possible to artificially send energy to the body?
How did the Super Star Destroyer Executor get destroyed exactly?
Fake forking your own repo for maintainability purpose
How to selectively merge or pick changes from another branch in Git?Git workflow and rebase vs merge questionsHow to merge a specific commit in GitWhy does git perform fast-forward merges by default?Merge all changes from another branch as a single commitCreate a branch in Git from another branchWhat is the best (and safest) way to merge a Git branch into master?Git fetch remote branchDelete forked repo from GitHubGit merge master into feature branch
I am not sure how to precisely describe the issue so I will use an example, say i have the following:
RepoA
- original repo with some base code, libs, framework, folder structure, etcRepoB
- ideally a fork/branch... but can't fork your own repos and I want a separate repo, so branch doesn't work
The goal is to work on RepoB
and be able to merge
changes that have been made inside RepoA
into the code, so if a new feature is developed on RepoA
I can just merge it into the RepoB
and continue development. Essentially it is a "branch" of a different repo.
Is this somehow possible?
I've also thought of maybe somehow using NPM to get this functionality but I am not sure at all how to/how it works with NPM, all my work on company projects would have a single repo and feature branches, so I've never encountered this problem.
EDIT: As per comments
The idea is to setup a repo structure with all the things that I commonly use in multiple projects, such as boilerplate, UI components, blank server, router configurations, basically create a "framework" that has no features, other than being a "work environment" that can be built upon.
Then, for each project, i'd create a specific repo and drag in the framework, for lack of the better words. But I want to be able to "merge" additional things that might get added to framework at a later point into the repo.
I do not want to branch this framework repo because I want the repositories on github to be separate. I'd be fine with somehow adding some form of dependency, or even use NPM, but I do not know how would I use NPM for this.
git github
|
show 7 more comments
I am not sure how to precisely describe the issue so I will use an example, say i have the following:
RepoA
- original repo with some base code, libs, framework, folder structure, etcRepoB
- ideally a fork/branch... but can't fork your own repos and I want a separate repo, so branch doesn't work
The goal is to work on RepoB
and be able to merge
changes that have been made inside RepoA
into the code, so if a new feature is developed on RepoA
I can just merge it into the RepoB
and continue development. Essentially it is a "branch" of a different repo.
Is this somehow possible?
I've also thought of maybe somehow using NPM to get this functionality but I am not sure at all how to/how it works with NPM, all my work on company projects would have a single repo and feature branches, so I've never encountered this problem.
EDIT: As per comments
The idea is to setup a repo structure with all the things that I commonly use in multiple projects, such as boilerplate, UI components, blank server, router configurations, basically create a "framework" that has no features, other than being a "work environment" that can be built upon.
Then, for each project, i'd create a specific repo and drag in the framework, for lack of the better words. But I want to be able to "merge" additional things that might get added to framework at a later point into the repo.
I do not want to branch this framework repo because I want the repositories on github to be separate. I'd be fine with somehow adding some form of dependency, or even use NPM, but I do not know how would I use NPM for this.
git github
6
I fail to see how a forked repository would serve you better than a branch would in that case...
– ccjmne
Mar 7 at 22:56
1
@Dellirium Maybe describe what problem you think you would have with a single repo. (@ccjmne Agreed.)
– RomainValeri
Mar 7 at 23:04
@ccjmne edited the post to reflect
– Dellirium
Mar 8 at 0:33
At least for github you can set up a separate organization and fork from your own repos into the org. I've used that myself while testing out some experimental CI solutions while not bogging down builds.
– Anthony Sottile
Mar 8 at 1:12
1
@Tony thanks for the reminder, totally forgot, been a loooong night
– Dellirium
Mar 9 at 17:30
|
show 7 more comments
I am not sure how to precisely describe the issue so I will use an example, say i have the following:
RepoA
- original repo with some base code, libs, framework, folder structure, etcRepoB
- ideally a fork/branch... but can't fork your own repos and I want a separate repo, so branch doesn't work
The goal is to work on RepoB
and be able to merge
changes that have been made inside RepoA
into the code, so if a new feature is developed on RepoA
I can just merge it into the RepoB
and continue development. Essentially it is a "branch" of a different repo.
Is this somehow possible?
I've also thought of maybe somehow using NPM to get this functionality but I am not sure at all how to/how it works with NPM, all my work on company projects would have a single repo and feature branches, so I've never encountered this problem.
EDIT: As per comments
The idea is to setup a repo structure with all the things that I commonly use in multiple projects, such as boilerplate, UI components, blank server, router configurations, basically create a "framework" that has no features, other than being a "work environment" that can be built upon.
Then, for each project, i'd create a specific repo and drag in the framework, for lack of the better words. But I want to be able to "merge" additional things that might get added to framework at a later point into the repo.
I do not want to branch this framework repo because I want the repositories on github to be separate. I'd be fine with somehow adding some form of dependency, or even use NPM, but I do not know how would I use NPM for this.
git github
I am not sure how to precisely describe the issue so I will use an example, say i have the following:
RepoA
- original repo with some base code, libs, framework, folder structure, etcRepoB
- ideally a fork/branch... but can't fork your own repos and I want a separate repo, so branch doesn't work
The goal is to work on RepoB
and be able to merge
changes that have been made inside RepoA
into the code, so if a new feature is developed on RepoA
I can just merge it into the RepoB
and continue development. Essentially it is a "branch" of a different repo.
Is this somehow possible?
I've also thought of maybe somehow using NPM to get this functionality but I am not sure at all how to/how it works with NPM, all my work on company projects would have a single repo and feature branches, so I've never encountered this problem.
EDIT: As per comments
The idea is to setup a repo structure with all the things that I commonly use in multiple projects, such as boilerplate, UI components, blank server, router configurations, basically create a "framework" that has no features, other than being a "work environment" that can be built upon.
Then, for each project, i'd create a specific repo and drag in the framework, for lack of the better words. But I want to be able to "merge" additional things that might get added to framework at a later point into the repo.
I do not want to branch this framework repo because I want the repositories on github to be separate. I'd be fine with somehow adding some form of dependency, or even use NPM, but I do not know how would I use NPM for this.
git github
git github
edited Mar 8 at 1:06
Dellirium
asked Mar 7 at 22:52
DelliriumDellirium
718819
718819
6
I fail to see how a forked repository would serve you better than a branch would in that case...
– ccjmne
Mar 7 at 22:56
1
@Dellirium Maybe describe what problem you think you would have with a single repo. (@ccjmne Agreed.)
– RomainValeri
Mar 7 at 23:04
@ccjmne edited the post to reflect
– Dellirium
Mar 8 at 0:33
At least for github you can set up a separate organization and fork from your own repos into the org. I've used that myself while testing out some experimental CI solutions while not bogging down builds.
– Anthony Sottile
Mar 8 at 1:12
1
@Tony thanks for the reminder, totally forgot, been a loooong night
– Dellirium
Mar 9 at 17:30
|
show 7 more comments
6
I fail to see how a forked repository would serve you better than a branch would in that case...
– ccjmne
Mar 7 at 22:56
1
@Dellirium Maybe describe what problem you think you would have with a single repo. (@ccjmne Agreed.)
– RomainValeri
Mar 7 at 23:04
@ccjmne edited the post to reflect
– Dellirium
Mar 8 at 0:33
At least for github you can set up a separate organization and fork from your own repos into the org. I've used that myself while testing out some experimental CI solutions while not bogging down builds.
– Anthony Sottile
Mar 8 at 1:12
1
@Tony thanks for the reminder, totally forgot, been a loooong night
– Dellirium
Mar 9 at 17:30
6
6
I fail to see how a forked repository would serve you better than a branch would in that case...
– ccjmne
Mar 7 at 22:56
I fail to see how a forked repository would serve you better than a branch would in that case...
– ccjmne
Mar 7 at 22:56
1
1
@Dellirium Maybe describe what problem you think you would have with a single repo. (@ccjmne Agreed.)
– RomainValeri
Mar 7 at 23:04
@Dellirium Maybe describe what problem you think you would have with a single repo. (@ccjmne Agreed.)
– RomainValeri
Mar 7 at 23:04
@ccjmne edited the post to reflect
– Dellirium
Mar 8 at 0:33
@ccjmne edited the post to reflect
– Dellirium
Mar 8 at 0:33
At least for github you can set up a separate organization and fork from your own repos into the org. I've used that myself while testing out some experimental CI solutions while not bogging down builds.
– Anthony Sottile
Mar 8 at 1:12
At least for github you can set up a separate organization and fork from your own repos into the org. I've used that myself while testing out some experimental CI solutions while not bogging down builds.
– Anthony Sottile
Mar 8 at 1:12
1
1
@Tony thanks for the reminder, totally forgot, been a loooong night
– Dellirium
Mar 9 at 17:30
@Tony thanks for the reminder, totally forgot, been a loooong night
– Dellirium
Mar 9 at 17:30
|
show 7 more comments
1 Answer
1
active
oldest
votes
So after some fiddling around with what Mohana Rao suggested I've managed to get what I need.
One-time-use
We are doing all our work inside RepoB
, say, on a master branch:
git remote add base <link-to-RepoA>
git checkout -b new-feature-import
git pull base master --allow-unrelated-histories
git checkout master
git merge new-feature-import
git branch -D new-feature-import
Saving for future usage:
git remote add base <link-to-RepoA>
git fetch base
git checkout -b base-integration
git branch --set-upstream-to=base/master
git pull --allow-unrelated-histories
git checkout master
git merge base-integration
With the second method allowing you to switch to a branch at a later point and just do a pull to get the latest changes. Obviously any merge conflicts you'd have to resolve and obviously you should not be pushing from the base-integration
branch back to your RepoA
if you opt to go with this "more convenient" solution.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054083%2ffake-forking-your-own-repo-for-maintainability-purpose%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
So after some fiddling around with what Mohana Rao suggested I've managed to get what I need.
One-time-use
We are doing all our work inside RepoB
, say, on a master branch:
git remote add base <link-to-RepoA>
git checkout -b new-feature-import
git pull base master --allow-unrelated-histories
git checkout master
git merge new-feature-import
git branch -D new-feature-import
Saving for future usage:
git remote add base <link-to-RepoA>
git fetch base
git checkout -b base-integration
git branch --set-upstream-to=base/master
git pull --allow-unrelated-histories
git checkout master
git merge base-integration
With the second method allowing you to switch to a branch at a later point and just do a pull to get the latest changes. Obviously any merge conflicts you'd have to resolve and obviously you should not be pushing from the base-integration
branch back to your RepoA
if you opt to go with this "more convenient" solution.
add a comment |
So after some fiddling around with what Mohana Rao suggested I've managed to get what I need.
One-time-use
We are doing all our work inside RepoB
, say, on a master branch:
git remote add base <link-to-RepoA>
git checkout -b new-feature-import
git pull base master --allow-unrelated-histories
git checkout master
git merge new-feature-import
git branch -D new-feature-import
Saving for future usage:
git remote add base <link-to-RepoA>
git fetch base
git checkout -b base-integration
git branch --set-upstream-to=base/master
git pull --allow-unrelated-histories
git checkout master
git merge base-integration
With the second method allowing you to switch to a branch at a later point and just do a pull to get the latest changes. Obviously any merge conflicts you'd have to resolve and obviously you should not be pushing from the base-integration
branch back to your RepoA
if you opt to go with this "more convenient" solution.
add a comment |
So after some fiddling around with what Mohana Rao suggested I've managed to get what I need.
One-time-use
We are doing all our work inside RepoB
, say, on a master branch:
git remote add base <link-to-RepoA>
git checkout -b new-feature-import
git pull base master --allow-unrelated-histories
git checkout master
git merge new-feature-import
git branch -D new-feature-import
Saving for future usage:
git remote add base <link-to-RepoA>
git fetch base
git checkout -b base-integration
git branch --set-upstream-to=base/master
git pull --allow-unrelated-histories
git checkout master
git merge base-integration
With the second method allowing you to switch to a branch at a later point and just do a pull to get the latest changes. Obviously any merge conflicts you'd have to resolve and obviously you should not be pushing from the base-integration
branch back to your RepoA
if you opt to go with this "more convenient" solution.
So after some fiddling around with what Mohana Rao suggested I've managed to get what I need.
One-time-use
We are doing all our work inside RepoB
, say, on a master branch:
git remote add base <link-to-RepoA>
git checkout -b new-feature-import
git pull base master --allow-unrelated-histories
git checkout master
git merge new-feature-import
git branch -D new-feature-import
Saving for future usage:
git remote add base <link-to-RepoA>
git fetch base
git checkout -b base-integration
git branch --set-upstream-to=base/master
git pull --allow-unrelated-histories
git checkout master
git merge base-integration
With the second method allowing you to switch to a branch at a later point and just do a pull to get the latest changes. Obviously any merge conflicts you'd have to resolve and obviously you should not be pushing from the base-integration
branch back to your RepoA
if you opt to go with this "more convenient" solution.
answered Mar 9 at 17:30
DelliriumDellirium
718819
718819
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054083%2ffake-forking-your-own-repo-for-maintainability-purpose%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
6
I fail to see how a forked repository would serve you better than a branch would in that case...
– ccjmne
Mar 7 at 22:56
1
@Dellirium Maybe describe what problem you think you would have with a single repo. (@ccjmne Agreed.)
– RomainValeri
Mar 7 at 23:04
@ccjmne edited the post to reflect
– Dellirium
Mar 8 at 0:33
At least for github you can set up a separate organization and fork from your own repos into the org. I've used that myself while testing out some experimental CI solutions while not bogging down builds.
– Anthony Sottile
Mar 8 at 1:12
1
@Tony thanks for the reminder, totally forgot, been a loooong night
– Dellirium
Mar 9 at 17:30