Reputation: 349
I have an existing git project, let's call it BobCrane. This needed to completely re-work this project's extensive directory structure.
I created the needed directory structure on the filesystem, outside of any git project. I then manually copied each file from the cloned BobCrane repo into this new directory structure. So the new directories are filled with old files; there are only one or two new ones that didn't exist before.
How can I add/commit/push this new structure to the existing git repo? Is this related to "rebasing"?
Upvotes: 2
Views: 1501
Reputation: 1375
git init
git add -A git commit -m "commit message"
git remote add origin your_existing_repository@url
git pull origin remote_branch_name
git add -A git merge --continue
git fetch
5.1. Rebase onto remote branch
git rebase origin/remote_branch_name
5.2. Resolve conflicts if any and execute
git add -A git rebase --continue
git push -u origin remote_branch_name
Rebase is preferred way because it will produce cleaner commits history
Upvotes: 4