how to recover a wampserver root folder from git - database

I was working on a project that i kept in wampserver root folder. I used a local git repository to save every step of the work. at some point I forgot that the files were inside wampserver and I deleted wampserver to install it again when it was stuck. the folder is not kept in recycle bin too. is there a way I can recover my whole project folder from the last git commit?

It depends if that local Git repository was pushed anywhere (GitHub, GitLab, BitBucket, ...) or not.
Because if that local repository was not pushed or cloned, then it is a simple local set of files, deleted when the wampserver was deleted.
In which case, only some file/data recovery software would be your only approach.

Related

Not able to push to new repository on Github

I created a repository on GitHub and pushed successfully to it. However, I had trouble pushing my 'backend' folder. Eventually I did get but it still didn't look the same as the code I had on VS Code. For sake of organization I decided to delete that repository and create a new one. This time the folders I was missing previously (two parents folders, one for frontend, one for backend) managed to upload but all the files inside them (that were pushed to previously deleted repository) didn't get pushed to my new repository.
Git add -A and git add . don't change anything.
git push, returns 'Everything up-to-date'.
git remote is connected just fine.
Please help stack overflow community, you're my only hope. current repository if it helps: https://github.com/mazorSharp/mern-e-commerce
Your backend and frontend entries in the listed repository are both gitlinks: the main operating part of a submodule. You get a submodule because you told Git to store a Git repository inside a Git repository. Git literally cannot store a Git repository inside a Git repository, so it won't. Instead, Git adds what I like to call a "half-assed submodule": the part that says use this particular commit: ______ (insert hash ID here) from the associated Git repository.
The reason this is "half-assed" is that the "associated" Git repository isn't associated. To be associated, Git needs a separate piece of information. To put that information into Git—which you need only do once per submodule—you would normally use git submodule add. This will create or update the .gitmodules file, in which the association information is stored. Once you have both pieces of information, the gitlink becomes useful ("fully assed"?).
Once you have a proper submodule, cloning the superproject gets you a repository that refers to some other repository. That other repository is not yet cloned so you must run git submodule update --init or equivalent. This tells your Git software to poke around in the submodule instructions (in the .gitmodules file), figure out whether you have the submodules properly cloned yet, and if not, clone them. Then, once the submodules are cloned, git submodule update (with or without --init) will look at each gitlink, which says which commit hash ID to use out of each submodule, and will enter each submodule, one at a time, and check out the correct hash ID, resulting in a detached-HEAD setup in the submodule. This is how submodules are intended to be used. (They are annoying to use, and rather brittle, so some people call them sob-modules.)
If you don't want submodules—whether you do or don't want them is your decision, that no one else can make for you—you'll have to remove the repository-ness of the subdirectories in question. To do that, you will need to move or remove the .git file-or-directory that is found in backend/ and frontend/ in your working tree. Note that if .git is a folder full of files, it contains the entire repository, i.e., all of the history; removing it removes this history, leaving you with just one set of checked-out files. If that's not what you want to do, don't remove the .git, just move it completely out of this part of your file system.
Probably you need to delete .git folder by using the following command and start with git init and point to the new repository. Note: This will remove your all previous commits.
rm -rf .git
Or else you can change the upstream URL by using this command,
git remote set-url origin <<new git url>>

Git didn't add x64\SQLite.Interop.dll

I installed SQLite into my WPF project via Nuget. Then added the entire project to a remote repo. Then I cloned the project on another machine, and had a broken build.
x64\SQLite.Interop.dll was missing.
I'm puzzled why Git didn't include one file from my project. I checked the repo on BitBucket and confirmed it is not there. Git status reports nothing to commit, working directory clean
It added the x86 version, but not the x64 version, I can't imagine why.
(project)\x64\SQLite.Interop.dll Git ignored this file!
(project)\x86\SQLite.Interop.dll
You might want to check the .gitignore file at the root of the repo. If it contains for example x64, it would ignore this file.
There would be two main possibilities then:
edit this file to fit your need
or force this file to be added; ie: git add -f x64/SQLite.Interop.dll
However, committing binary files is often frowned upon. It's true in particular if you want to keep up to date with the latest package, hence if you plan to commit new versions of the dlls on a regular basis.
You might rather want to consider Nuget package restore feature. Basically the idea is that you commit a config file, and the client will automatically download the corresponding packages.

Composer update root package

I want to make the system updates based on composer
With updating dependencies no special problems, but how to update the root package, it is not clear
I'm trying to understand the code composer and so far without success
I think a root project put into dependencies and leave only the bare minimum
or download the project archive from the github and manually remake it
Maybe someone faced with such a task
I don't think there is any way to update the main project.
This is when you've, say, installed a project with composer create-project proj/name . * or similar? Running composer update of course updates the dependencies, but nothing exists to update the project itself.
One way to do it might be as you say, and make the root project nothing but a composer.json file that lists the dependencies, and move the project to operate as a dependency. Bit of a change to the structure though, so this mightn't be possible.
You'll have to use git to do this. This is currently not possible using composer. I was faced with the same problem.
Publish your project on github (or another service)
Install git on the server
Clone the project from git (using git clone git#github.com:whatever folder-name) onto your server wherever you want your root folder located
Whenever you need to update the root project, open a git command window from the root project directory, and run git pull origin v1.0.1. This will essentially patch the project files from the tag you specify.

DNN 7 in-place upgrade install folder contents

I am having some trouble upgrading my dnn 7 website. I am upgrading from 7.0.5 to 7.0.6 and I have previously tried upgrading to 7.1.0 but I ran into errors, now I have left over files from the previous upgrades left in the instal/authSystem install/provider install/module folders.
Can I empty these folders before copying over the upgrade package over the current version? Should they be empty? or how can I figure out what the default contents should be for the install folder when upgrading.
As to your question, simply empty the INSTALL folder and get the INSTALL folder from the upgrade package.
Really though, you should take your backup from before you attempted the upgrade, and take all of the files from that backup, and start with those, essentially starting with a clean folder, copy the files into that folder from the backup, then perform the upgrade.

Why isn't GIT tracking my cakephp migrations Plugin?

I am using GIT to deploy my cakephp applications, a few days ago I started using the migrations plugin (by cakeDC) in my app to simplify database versions and changes.
After installing the Migrations Plugin on my local development machine, I committed the changes and pushed it to my production server, and tried to run the migrations plugin from there.
After looking at the server for quite some time I realized it had not grabbed all of the migrations plugin, however the following were changed:
app/Config/bootstrap.php had the following line appended
CakePlugin::load('Migrations');
The Plugin folder now had a Migrations folder, but it was empty.
I resolved this by uploading the plugin via FTP. I ran a git status on it and it shows the working directory clean...
Why isnt GIT tracking my Migrations plugin folder contents?
The Plugin folder is not being tracked because GIT thought it was a submodule.
I ran into this issue because I used GIT to clone this Plugin into the plugin directory. and git didnt add it since it was a repository in itself. When GIT didnt add it to my tracked files I did it manually: git add app/Plugin/Migrations/
this created a gitlink and essentially acted like a submodule, as seen in this thread:
Git - how to track untracked content?
Since at the time I didnt want to use the plugin as a submodule, I corrected this issue with the following commands:
git rm --cached app/Plugin/Migrations
with a git status I could see that GIT was now recognizing my Plugin
I then could proceed with a git add . and git commit -m "finally adding the plugin"
I hope this helps someone in the future.
Thanks!

Resources