I've an old project in the production. The code of this project is in my local pc without the images that uploaded in the server. Today I've extended the project with new features.
Now I want to use git with this project. I've initialize git in it. Then I have created a repository to my bitbucket account and I have pushed my project from my local pc.
The problem that I have is that I want to
As always before trying something out: do a backup beforehand
In case the folder
public/img/ does not exist in the repository (is not tracked) the case is quite easy.
Initialize an empty git repository in this folder
$ git init Initialized empty Git repository in /some-directory/
Add your bitbucket repository as a remote
$ git remote add origin <url-to-bitbucket-git-repo>
Fetch all your fresh changes
$ git fetch origin
Finally check out the branch you want (assuming master) and set up tracking
$ git checkout --track origin/master
It will not overwrite your
public/img/ folder if it does not exist in the repository
Create a new branch to hold the old files
git checkout -b <old-application> git add -v old-application-files/ git commit # Message should indicate that this is an older state of the application
Make sure not include the images folder into this commit (these commits)
git checkout master should work and you can see what was changes between the old state and the current one by doing a git diff
git diff <old-application> master
In the future simply go to this folder and do a