Where are the physical files located at on disk? In Stash, it tells me the directory the repository is in is located here:
but when I browse this folder, my files aren't in there. I am asking because we are using the system as a development-test system for webpages, and the repo location is going to act as a symlink to a public_html directory for each project we have (So we can push changes to the repo and instantly see the changes).
So my question is, where are the actual files stored at on-disk, can I can create a symlink from that location.
The other answers here are correct in that it isn't possible to symlink directly to the files in the repository. However, you could use a git post-receive hook to copy the files from the latest version of your master branch to a directory on your server after each push. This article has a good walkthrough that should get you up and running.
I really like your answer, except it appears the information given in the article doesn't work. I tried using the script given in the article, and modified it to fit my needs, but it appears it never gets triggered. I am on a different system, pushing my changes to a dedicated machine on a different IP. The post-receive script is in the hooks folder of the repository I am pushing to, and I assumed that the hooks monitor for changes on the bare repo, but it doesn't appear to be triggering at all after I push changes.
just to reassure you've done everything right: the script has to be in the
folder. Putting it into the hooks folder of your cloned repository and pushing it to to STASH-server WILL NOT work, as the hooks are not part of the things which get pushed to the remote repository or get cloned ....
Please note that Stash installs its own post-receive hook in STASH_HOME/shared/data/repositories/<ID>/hooks (or for older versions in STASH_HOME/data/repositories/<ID>/hooks).
You should not overwrite this hook because Stash needs it for its own processing. You can install custom hooks in the ../data/repositories/<ID>/hooks/post-receive.d
Just to confirm, I placed the file in my STASH_HOME/shared/data/repositories/10/hooks/post-receive.d/ and called it commit: Here is the pastebin of the code contained within
nothing is displayed anywhere, and the files are never pushed to the directory
A couple of things could be wrong.
The information of the location of the Git repo on disk is shown in the UI. If you browse through your Project and then through your Repo, you can access the repo settings which contains the location on disk. It is very similar to what you wrote for Stash release 3.2+: <Stash_Install>/shared/data/repositories/<ID>
If this directory is empty, it means the repository in the UI is empty as well and you shouldn't see any files there (i.e. repo was created but nothing was pushed into it).
As long as you have a different directory in a file system pointing to the <Stash_Install>/shared/data/repositories/ directory, I don't see any problem if it is only a read access. The repo structure should not be modified by anything other than Stash itself.
Does that make sense?
What I meant by my files aren't there, is doing an ls on the directory, it doesn't list my files. For example, index.php
instead it lists 5 directories and 3 files
As stated, I need to be able to access my physical files, so I can symlink them to my public_html directory so when a developer pushes changes, they can view them immediately.
From your answer to Johannes I got what you wanted. I am really sorry for not getting you at first.
What you want unfortunately isn't exactly how Git works. As explained by Johannes, the repos created in/by Stash are bare repos (that's the only way to get Git on a server so your developers can push into the central repo) thus you won't be able to see working files by directly browsing the Git repo file structure.
In order to retrieve your files, you will need to git clone your repository first.
By the sounds of it, what you really seem to want is a Continuous Integration / Continuous Delivery type of environment. Our Bamboo product would be able to build the files you pushed into Stash (a push in a Git repo hosted on Stash can trigger a new build in Bamboo, for instance) and deploy it afterwards.
Alternatively, if you don't want to set up a CI/CD system which understanbly requires time and financial investiments, you'd have to do a script to clone the repo and manually deploy it. The symlink won't be a valid alternative for you.
I hope that helps.
This doesn't really help me than and solve my issue. If they only show as bare repositories, than obviously I can't use it as a symlink for public_html. My question was where are the physical files stored at on the system. I need the actual location of the physical files on the repository so that I can symlink the public_html there so when the developers visit the development test site after they push a change, they immediately see the changes.
The most basic data storage is the blob. Git stores just the contents of the file for tracking history, and not just the differences between individual files for each change. The contents are then referenced by a 40 character SHA1 hash of the contents, which means it’s pretty much guaranteed to be unique. Pretty much every object, be it a commit, tree, or blob has a SHA, so learn to love them. Luckily, they’re easily referenced by the first 7 characters which are usually enough to identify the whole string.
If you want to have a "test site" I would recommend you using a cron to clone the repository each 1 minute, and this clone path can be used as symlink to the webserver.
Create a folder site, use a cron like "git pull repo_url destination path" and point the webserver documentroot to this path.
Please let me know if this help you.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs