After a server crash, the appX.git folder on the server is almost all there, object files are intact, but I Lost the appX.git/refs folder and packed-refs file. How do I recreate these references without the client files?
On the web interface it shows issues, project members but no files on the repository
Assuming there is no GitLab backup done to restore (through, for instance, gitaly-backup), one possible workaround is to:
create a new one with the different name
push back a local clone to the new one
copy the refs folder of the new one to the old incomplete one on the server
If, however, "without the client files" means there is no local clone anywhere... then there is no obvious solution.
Related
I currently work on solutions / projects within a single GIT repository, in Visual Studio. The commits I make are to a local folder on the Visual Studio server, and then I use the command 'git push origin master' (after having changed directory to my local folder / repository) to push commits to a Gitlab in my company's corporate space. The purpose of this is less about using branches and software development (as I am the only person who does any work on this), and more about having a way to rollback changes and keep a master copy off the server.
I now want a fresh copy of this GIT repository, so I can use that as a new baseline for an application migration. I will still continue to work on the existing repository too.
What is the best way to make a copy of the existing repository, that I can treat as a totally separate thing, without accidently messing up my existing config on the server? Should I do the clone from the Gitlab? Or clone locally and then push that up to the new space in my Gitlab? Honestly, I'm a bit confused at this point about the proper model for this stuff.
....................
Sounds like you'd like to fork the project: keep the existing repo and start a new, separate repo based on the old one.
Browse to your project in Gitlab
On the main repo screen, click "fork" in the top right
Select a new/ the same organisation as you'd like
The project is now forked!
From here, you can clone the fork to your local machine in a new folder. These are now separate projects, and code updates can be added, committed and pushed to the separate repos.
I have figured a way (using a few different tutorials) on how to push a local repo to a remote --bare repo that the uses a post-receive hook to push the contents to a live location.
So in brief explanation of my current situation
Make a change to a website locally
Use "git push live master"
Commit gets uploaded to remote repo
Remote repo pushes the contents to /home/unixuser/public_html
But say on this website there is an upload form where an admin can upload articles (on the live site), or where users can upload profile images. How would I sync my local repo with the new content in "public_html" as the repo is actually stored somewhere else on the server?
This sounds pretty simple but whenever I search for this I seem to get just the part on how to do post-receive scripts and how to upload, rather than the download part... or an over bloated explanation that leaves me confused. Is there a simplified answer to this question or am I possibly going about the whole thing the wrong way.
Any answers are appreciated, thanks!
Maybe you just need a copy script for whenever a new file is uploaded to copy it in your repo, commit + push that.
An other solution would be to use a second repository:
git-ignore the upload directory in your current repo. use a second repo which runs on the server, watching the upload directory - you just need to syncronize it to your local machine then. with git-ignore in the old repo, you could actually place the "upload"-repo inside the folder structure of the old repo (like it is on your server folder structure?)
I'm moving my current server contents to a new one, and am currently in the process of setting up SVN. I'm fairly unfamiliar with SVN, typically using it to the extent of commits and updates.
I have two locations that I use SVN on the old server:
PROD location:
/var/www/html/new_dwutils/
and local:
/home/{user_name}/public_html/new_dwutils/
My interaction svn-wise is normally committing and updating at the /new_dwutils/ level.
Note: Running svn --version says I'm at version 1.6.11 for both servers.
I'm now trying to recreate this structure on the new server. My initial thought was to create the svn repo using something like:
svnadmin create /var/www/html/new_dwutils/
This creates the repo dir, but, when I copy my files into the dir, I am unable to do svn commands like status. However, when I go into a sub-dir of the copied data, I can use the svn commands.
This has me thinking that the repo is /new_dwutils/ and the copied data is considered a project? And the sub-dirs are working copies then?
Going off that thought, I deleted the repo, and made the html dir a repo:
svnadmin create /var/www/html/
I then copied my new_dwutils dir, and sure enough, I was able to do svn commands like I use too. What I've noticed is that when creating the repo, a few things are added that were not on the previous server: conf/, db/, format, hooks/, locks/, and README.txt. I get that these are svn files, but I'm not seeing the .svn file. I know that there was an update for svn that "removed" .svn files, but these files are now in /var/www/html/.
Now I want to setup my local working copy.
I've been doing (location /home/{user_name}/public_html/):
svn checkout file:///var/www/html/
Problem is it copies the html/ file, but nothing in it, and I don't want the html/ file I want the html/new_dwutils/ file.
I feel like I'm doing it wrong from the start, and would greatly appreciate some explanation on how to get on the right track. A step by step would be extremely useful, and if further clarification is need for files or directory paths, I would gladly detail.
Thanks!
The Subversion Manual will answer all of your questions.
If you're making a Subversion repository under /var/www.html, I'm assuming you're using Apache httpd as your server. Look at Chapter 6. If you already have a repo, create a dump file, then use that dump file to recreate the repo. Look at Chapter 5 on moving repositories.
If you don't know anything about Subversion, or are confused by the difference between the repository location directory and a working directory, read the on-line manual. It's one of the best pieces of documentation I've seen.
From description of your question it appears that '/var/www/html/new_dwutils/' is your working copy and not a repo.
Go to '/var/www/html/new_dwutils/' on the old server and type "svn info" this should give you location of the old repo. You should simply be able to 'svn co ' into the new location to checkout a copy of all your files from the old server (everything that is checked in - you will not get anything that is not checked in on the old server).
However, if your repo was local on the old server and you want to move it to your new server too. Then you can simply copy the entire folder to the new server and access it directly using its new location in 'svn co' command.
I created a new project in svn svnadmin create /myrepo in my server, with my client I did a checkout and add new files, later a commit, so, if I make a checkout from another computer I get the recently added files, which is perfect, but at my folder /myrepo still is no file, all the new files that were added from my client are not visible there, I know they implement many algoritms to take the version control, my question is, should I be able to see all the new files added from /myrepo in my server, without need to make a checkout with a client or something like that??
I want to know where my files are saved at my server,
Thanks
No. The files are stored in the repository you created, but in a specialized database. If you go to myrepo and look in the db folder, you'll see that there are revision files stored there. Those files contain the structure and data of the repository at specific instances in time. The Subversion book has some information on the structure. You can also look at the documentation in the actual Subversion repository about the structure used to store the data.
As described in the header, I lost a hard drive that had a tortoise repository on it, but I managed to recover the files folder from that drive, unfortunately without the repository.
In the meantime the recovered folder now has a "!" icon on it, and I can't do anything with it (clean up, relocate, check in) since it says that it can't find its old repository.
Is there any way to move it to an existing repository on the new drive, or even just create a new one?
Thanks!
Cleanup doesn't require access to the repository. If even cleanup fails, then your backup wasn't complete or completely successful because the working copy is broken.
If you lost the repository, then you have to start from scratch (now you know why backups are important). Since you still have the files from your working copy, copy them to the new drive, then remove all hidden .svn folders. After that, you can import those files in a fresh repository.