How to add git repo to working dir of a project
I have a git repo in BitBucket, with a big project. I also have the same project locally on my computer in a dir, that is not under git. In my local dir, there are quite a few modifications that are not present in the repo, which I want to commit.
So, how do I sync the local dir, with the git repo, to be able to commit my changes and continue from there on. It’s ok the changes to go in the master, I’m looking for the simplest possible solution.
Edit: For clarification, I’ve been working on SVN, had some uncommitted changes when I finally decided to switch to GIT. So I imported the SVN history to GIT using
git-svn, then disconnected the local project from SVN.
One Solution collect form web for “How to add git repo to working dir of a project”
Set up a Git repo in the working directory:
Commit whatever you have:
git add . git commit
git add . assumes you have no files to ignore; maybe do this per file or copy over the
Now, add the Bitbucket repo as a remote:
git remote add origin <url>
Pull and rebase from Bitbucket:
git pull --rebase origin master
And when you’re satisfied with the results, push them:
git push -u origin master