my current setup is as follows:
We have a Linux samba share that contains all the repository folders (with the hooks folder inside, amongst the others)
All the developers have the share mapped as a network drive, and import to a local directory (normally C:\Server\RepositoryName) where they work on their files.
All the machines accessing the drive (unfortunately) run windows.
What I'm aiming to do is to have a hook on the Linux server that detects when a commit has been made, by which project, the revision number, the name of the developer who committed, etc. I looked into the hooks files, but they seem to be ran by the client. Is there a way to monitor svn changes and collect the relevant information from the Linux server?
All the hooks are executed by svnserve. Check your hook scripts, svnserve configuration and http://subversion.apache.org/faq.html#hook-debugging
Related
I have a PC where I have both a Linux and a windows installation. I use a cloud service so I have access to my important files in both places, and they are synced.
Say I created a git repository, and pushed it to GitHub on windows. Now I suddenly feel the need to switch to my Linux installation to do some stuff. My cloud service does not sync the .git folder, since it's hidden in default by windows. (Would it lead to problems between os'es if i would sync it?). Therefore, Even though I have the same project (with exactly the same files) as on windows, Linux does not automatically recognize the VCS settings of the current project.
I found a somewhat dirty workaround, on Linux I
Initialize an empty rep: git init
Add a remote branch:git remote add Project_name https://github.com/Psychotechnopath/Project_name.git
Fetch the contents of the remote branch git fetch --all
Reset the head onto the remote master branch git reset --hard Project_name/master
Is this the best way to do it (e.g. respecting the git workflow), or are there more elegant ways?
I have mostly-successfully done this on the same filesystem; in my case I mounted the ntfs filesystem from Linux. Two things you have to be careful of:
don't make filenames that are the same on a case-insensitive file system but different on a case-sensitive one
pay special attention to your line endings, you may need to do some work in .gitattributes here
push often in case you find a git bug
If you don't mind having the world's slowest Linux system, you can also just run Linux under Windows via Window Services for Linux, WSL. (Not WSL 2, that's containers). In that case, you can access your windows repo from linux via the /mnt/c/ filesystem.
im using gitlab on a synology NAS.
for reasons of safety, i would like to automatically synchronise (mirror) the entire gitlab system on my NAS with my account on gitlab.com.
is there an easy way to do this?
Your entire gitlab repository is stored under /volume1/docker/gitlab/repositories (or a similar directory).
To synchronize, you would need to run a script to push a certain repository (which is in bare mode) to a gitlab. This shows how to do it to GitHub, so it should be similar for gitlab.com:
https://gist.github.com/joahking/780877
Once configured, you can use the task manager in Synology's control panel to execute the script regularly.
Good luck!
Assuming there's a Git repository hosted on a Linux machine and there are developers using both Windows and Linux, is there a way to prevent Linux developers from committing files with same names but different cases?
I think I've to write a server-side hook for this, but I don't know how to validate the names of incoming files inside the hook script.
Any help/references related to this would be appreciated.
If you want keep some files locally then git stash is your friend. stash usage
I'm developing an (Qt) application which should run under Windows and Linux. So, I want to be able to develop under Windows and Linux, too.
Therefore I have stored my project (as git repo) on a NTFS partition which I mount under Linux (Ubuntu 13.10). To avoid the rights problem of the compiled executable I set the shadow build directory to my home folder under Linux.
This approach work quit good so far. But there are some effects that make me worry: If I stage some changed files (with smartgit), smartgit doesn't reflect that I have stage them. They are still displayed as unstaged
Similar thing when commiting: After the commit, the commited changes are still display as if they where not commit. But in the log I can see they are commited. Closing an reopen the repo "solves" this issues or is a workaround at least.
But I have concerns that I break my repo using it on a NTFS partition under Linux. Or is there no risk that my repo is getting corrupted one day using it that way?
This answer has been given by Fco P. on the askubuntu question mirror. This happens because Windows and Linux deal with file permissions differently. Use
git config core.filemode false
to disable git tracking file permissions and solve this issue.
What's the best practice for setting up a subversion repository on a linux development machine. External users need to be able to access a specific repository, but nothing else on the machine. I know one answer is to set up a dedicated repository, but I'm looking for a single machine solution: location of repositories, accounts, backup procedures.
One of the popular access methods to Subversion is via Apache module. You can set put different rights at the directory level to control access. See Choosing a Server Configuration and httpd, the Apache HTTP Server. For authentication, I recommend using external authentication source like Microsoft AD via mod_auth_sspi.
If you need to mix and match rights, see my answer for How can I make only some folders show up for certain developers with SVN.
I work for an IT operations infrastructure automation company; we do this all the time.
Location of repository: We use "/srv/svn" by default to store all SVN repositories, unless a customer has a specific requirement, for example an existing repository might be stored on a ReadyNAS shared filesystem.
Accounts: All our customers use LDAP. Either OpenLDAP server running on a master host, but sometimes Active Directory because some customers have a Windows domain in their office, which we can configure as well. Developers get access to the "SCM" group (usually svn, git or devel), and the 'deploy' group. These groups only have permissions to log in and perform SCM related activities (ie, write commits to the repo based on group ownership), or do application deployments to production.
Backup procedures: We use svnadmin hotcopy unless the customer already has something in place (usually svnadmin dump, heh).
svnadmin hotcopy /srv/svn /srv/svn_backups/$(date +%Y%m%d)
For access to the repo, it's usually simple svn+ssh. Some customers already have an Apache setup, but not many. I recommend SSH. Developers push their public ssh keys out and all is well. There's little to no maintenance with LDAP user management (the only way to go).
I'd recommend looking at the chapter on server configuration in the subversion book. It makes suggestions about which configuration is more appropriate for your use.
For what it's worth, setting up a repository using the stand alone svn daemon is very straight forward. The annoying thing is managing user rights.
I have a blog posting that describes the steps necessary to set up and initiate a Linux-based Subversion server in order to maintain code repositories etc.
Basically the steps are:
Download the Subversion tarball.
Unzip and install Subversion.
Deal with any installation problems that arise when running ./configure, if any.
Create the Subversion repository using svnadmin create.
Edit the repository configuration file using your text editor of choice.
Ditto the password file.
Import your code, projects etc into the repository using svn import.
Start the server as a daemon eg svnserve -d. It is also possible to get it to do this automatically
upon reboot.
Start using it using standard Subversion commands to eg check out, check in, backup etc...