Reputation: 262
I want to merge two directories in the same branch.
I know git rules as if there is any required featured to add. I should have created a another another branch. and then i have to merge that branch into some another branch,
This is my current directory structure
App-
directory - 1
directory - 2
How to merge these two directories into one. I have already seen many questions related, But nothing worked
Without creating new branch
If there is another method to do this. Please suggest
Upvotes: 2
Views: 846
Reputation: 3509
I assume, that all your changes have been committed and that your branch with both directories is called both-directories
.
This approach will loose all your git commit history for directory - 2
and squash them into one commit. If you want to keep that commit history you have to modify step 1-5 for every commit before continuing with step 6.
directory - 2
to a folder outside of git. Lets call that folder outside-directory-2
directory - 2
and start a new branch from its ancestor. Call this branch something like directory2
.directory2
.outside-directory-2
to your directory - 1
folder.directory2
branch.both-directories
.directory2
directory - 2
and commit these changes.both-directories
contains all changes from directory - 1
and directory - 2
.Upvotes: 2