I don't know exactly how to put it but here is my problem: I have a git repository related to laravel project. I also have the same folder on local but i deleted the .git folder, .gitignore and .gitattrib files, i.e. my local folder is no longer connected to github. Now i have made changes to local files and want to push those to the original repository. How can i do that?
-
1How many files have you changed? The quick and dirty approach might be to clone that repository again, and then overwrite the files you've modified with your versions. – Tim Biegeleisen Apr 21 '17 at 04:25
-
You can see [this answer](http://stackoverflow.com/a/6246975/5085788), specifically the part of **uncommited changes**. – luisenrike Apr 21 '17 at 04:31
1 Answers
One way to do this would be to simply commit your changes as a new commit in your repository:
Ensure you have a clone of your repository locally
If needs be, reclone it, or if you already have one you can most likely reuse that clone.
Make sure you're on the right branch in that clone
If needs be, create and checkout a new branch for the modifications that you did locally while "unconnected to GitHub".
Then bring those changes into your working folder of the clone
Basically, copy from the local, "unconnected" folder
... and copy to the working folder of your repositoryNote! If any of your "local changes" involved deleting or moving file you need to ensure you do the same thing in your working folder.
If you got any kind of directory comparison tool, such as Beyond Compare, then you should use this to ensure you synchronize not just file contents but also directory structure.
- Then all you have to do is commit your modified files into your repository
- Do a
git status
to ensure everything looks good - Do a
git status --ignored
to ensure git won't ignore any files you care about - Do a
git add .
to stage your modifications - Do a
git commit
to commit your changes
- Do a
Verify everything looks good
Do a build, whatever
- Merge your changes into your main branch (develop or master or whatever)

- 380,855
- 102
- 628
- 825