I work on Linux all the time and I'm clueless about Windows not even having one to try it, is Git nowadays working on Windows? or am I making problems for my Windows-pals by using it?
I would like to open-source a python project on Github but it contains an API key that should not be distributed.
I guess there's something better than removing the key each time a "push" is committed to the repo.
Imagine a simplified foomodule.py :
import urllib2
API_KEY = 'XXXXXXXXX'
urllib2.urlopen("http://example.com/foo?id=123%s" % API_KEY ).read()
What i'm thinking is:
Move the API_KEY in a second key.py module importing it on foomodule.py; i would then add key.py on .gitignore file.
Same as 1 but using ConfigParser
Do you know a good programmatic way to handle this scenario?
I'm looking for a database where multiple users can contribute and commit new data; other users can then pull that data into their own database repository, all in a git-like manner. A transcriptional database, if you like; does such a thing exist?
My current thinking is to dump the database to a single file as SQL, but that could well get unwieldy once it is of any size. Another option is to dump the database and use the filesystem, but again it gets unwieldy once of any size.
I'm working on different projects with some small teams (2-3 people for each).
Those projects are about some scientific stuff, most (probably all) the code will be released under GPL after the publication of some results and we don't want to spend money for this.
My first question is: should i keep my local SVN server or you know some good service for this?
Both of them have some disadvantages and services like xp-dev.com looks pretty interesting but should i trust them? [i'll get only the free plan]
Online services give you some tools for project management, what do you think about them?
I'm currently employed at a small non-tech organisation and have been given the role of coding the organisations' website. While I have enjoyed the task and have learnt much with web dev I've encountered a few issues that I'm hoping someone will be able to help with me or at least point me in the right direction on.
A little background:
The site I work on has subdomains that each have their own separate WordPress installation on - as this has been the easiest "backend" admin panel for the type of user who will be responsible for updating content (etc).
Within the organisation I work under the Marketing Manager (MM) and I code according to his style guide and wire frames.
While we have been working with only one subdomain since the beginning of the year the project has been relatively simple and straightforward. However, lately the workflow is becoming a little more complicated as our original subdomain has been copied over to the other subdomains. Each of the new subdomains receives minor edits to their stylesheets (eg. different pictures for background, slightly different colours here and there, etc).
The issue:
At the moment managing all the different subdomains has been "bearable", but the straw that's braking the camel's back at the moment has been the slight reversions the MM has required now that the CEO has seen the final product. The problem I'm having with reversions in stylesheets is that the CEO will one week state that he likes change "X" and then as the MM and I continue to modify the site (to now "Z"), will another week state that he wants us to change "X" to "W" but keeping most of the changes made in "Y".
What I'm looking for is something that allows for:
tracking file changes
reverting changes made (or reverting back to 'a' from 'e' but including changes 'b' & 'c')
easily upload necessary files to their respective WP-theme installation
Does anything out there come close to addressing these issues? If so, what?
Thanks for any help!
PS - I'm learning Git at the moment and it seems to do the "tracking file changes" quite nicely. Haven't learnt about the reverting changes bit yet, though. Maybe for my final point I'm thinking of creating a shell script to automatically upload the files to their folders. Does Git do this too though?
Addendum (alexbbrown)
I had a similar problem: I ran a custom version of mediawiki where I installed various extensions in the versioned core (with svn). Each of the extensions required an section in the confit file, but the confit file also needed local configuration for each of several deployments. I could have implemented it using includes, but they would not be versioned; and rebasing branches each time is a chore. +50 experience points for a good answer in git.
I'm a happy user of PortableGit 1.7.0.2. Today I wanted to pull a project changes from GitHub.com repository, so I did git pull. It failed with the following message: error: Your local changes to 'main.rb' would be overwritten by merge. Aborting.. I didn't care about the local changes so I typed git reset --hard HEAD (git clean from here didn't help neither), but it didn't work. When asked for git status I was still able to see the file as modified. git diff showed me that each line of the file has been modified, while git diff -b showed no differences at all, so I guess this is a line ending issue. Which is strange because the code is only pushed from Windows machines.
Anyway, the question is: how can I ignore the local, bogus changes and merge with the latest changes from the remote repository?
Now that Bitbucket also supports Git repositories, it seams to me that it is a good alternative to GitHub, especially since its free plan includes unlimited private repositories, which is not available on GitHub. Yet, GitHub seams much more popular.
Are there any major reasons to choose GitHub as the hosting site for Git repositories instead of Bitbucket?
(Although I have no problems with making my personal projects publicly available in general, I like the idea of being able to make the switch from public to private or vice versa any time I want. But if there are some good reasons to use GitHub, I would be willing to give up this freedom.)
I don't even really know if the title is the best way to explain what I'm trying to do, but anyway...
We have a web app that is being ported to a number of DB backends via MDB2. Our unit tests are pretty lacking at the moment, but our internal users are pretty good at knowing what to test to see if things are broken.
What I'm 'imagining' is a browser plug in (don't really care which browser it is for) or a similar system that essentially takes every event from one window and 'mirrors' it in the other browser/s. The reason I'd like this is so that I can have various installations that use different DB backends, and have the user open a window/tab to each installation. From there, however, I'd like them to be able to 'work' in one window and have that 'work' I occur at the same time in each of the 'cloned' windows. From there, they should be able to do some quick eyeballing of the information that comes back, without having to worry about timing differences and so (very much).
I know it's a big ask, but I figure if anyone knows of a solution, I'd find it here...
Any thoughts?
I mean, we've all done it, making some changes and the checking them in with messages such "as made some changes" or "fixed a bug." Messages so inane, so pointless, you might as well have written "magical fun bus" in their place (of this, I am guilty), as it would be, perhaps, more descriptive. I ask you then, what is the most pointless, most off topic, strangest, or just WORST commit message you have ever authored?
Is it possible to create "federated" Subversion servers?
As in one server at location A and another at location B that sync up their local versions of the repository automatically. That way when someone at either location interacts with the repository they are accessing their respective local server and therefore has faster response times.
I have used Perforce previously and in current project we are using SVN. I noticed that it is very slow seeing revision logs and to see its comparisons in SVN relative to Perforce.
Is it because Perforce is a commercial solution or is it something with my SVN client(Smart SVN)?
The worst one I've been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but couldn't, so I forked. Now the submodule was pointing at the original library, and I needed it to point at the fork instead. So I deleted the old submodule and replaced it with a submodule for the new project in the same commit. Turns out that this broke everyone else's repositories. I'm still not sure what the correct way of handling this situation is, but I ended up deleting the submodule, having everyone pull and update, and then I created the new submodule, and had everyone pull and update again. It took the better portion of a day to figure that out.
What have other people done to accidentally screw up git repositories in non-obvious ways, and how did you resolve it?
I wanted to remove some files from the repository (while leaving them locally), and stop tracking them in the future.
I tried this:
- Used Tortoise 'Delete - Keep local' on the directory I wanted to remove from versioning.
- Comitted to the repository.
This commit failed with this error: commit failed... item is out of date
Can anyone tell me
a) What the correct procedure is for this?
b) What can I do to get back to a working repository?
Thank you!
I can use something like:
cvs.exe rdiff -D2010-03-23 -D2010-03-24 -s "ProjectName"
to get the changes which occurred on the 23rd.
But I want to get the changes that were checked in on the 23rd on a specified branch - and if I add in a -v branchv1-0-0-0 into that it tells me I can't have more than two dates/revisions in one query.
Any suggestions?
I've just installed Mercurial on my Mountain Lion Max (10.8) and on my first commit I'm getting the error:
abort: no username supplied (see "hg help config")
I've seen a load of answers which suggest I need to create or copy a file form a certain location and paste it into another location and add my username and email to the document.
If that is the right thing to do:
Where is the file I need to copy (or what is the file called that I need to create)
Where do I put that file
Do I just need to add the following two lines to the file?
[ui]
username = Your Name
Thanks guys.
I had to restructure the projects in SVN as it was not added as per the recommended repository structure (no tags, branches and trunk folders). However after moving projects to the new structure we have lost the history of all the files.
How can I get back the history of all the files?
I have a subversion repository, where each branch is a separate project. I would like to change this architecture, and to gradually move to mercurial. How can I convert a single branch of a subversion repo into an hg repository.
hg version : 1.01
We are currently using CS-RCS Pro for source code management, and are looking for to replace this due to performance issues. It is based on client side file access with no own protocol, which makes it painfully slow to use over a slow VPN line since it always rewrites the whole history of a file. It does however have a GUI client which is very simple and gives a great overview.
We have three main requirements in a SCM:
Fast. It must have a server side service or some other smart way so working with files with a large history is fast.
A good Windows GUI client (not Explorer shell integration, not VS or Eclipse IDE integration), so working with files and branches is easy.
The possibility to have several branches checked out at once in different directories.
Does anyone have a recommendation of a SCM which fulfills there requirements?
My code is
public static class ContainerBootstrapper
{
public static void BootstrapStructureMap()
{
ObjectFactory.Initialize(x => x
.ForRequestedType<ValueHolder>()
.CacheBy(InstanceScope.Singleton)
.TheDefaultIsConcreteType<ValueHolder>());
}
}
Initialization code (its a windows service)
static class Program
{
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new AppServer()
};
ServiceBase.Run(ServicesToRun);
ContainerBootstrapper.BootstrapStructureMap();
}
}
And then I call an instance like this:
var valueHolder = ObjectFactory.GetInstance<ValueHolder>();
But I get everytime an new instance not the one used before.
With IOC I understand you can substitue implementations out by merely editing a configuration file etc.
BUT, what happens when the classes are married to particular database tables and sprocs, you can't just swap out an implementation since the classes/entities are tied to particular tables and stored procedures.
Am I right here?
I'm using git for a personal project at the moment and have run into a problem of having one codebase for two different environments and was wondering what the cleanest way to use git would be.
Main Desktop
I Use this machine for most of my development. I have a git repository here that I cloned off of an empty repository that I use on my internal server. I do most of my work here and push back to the internal server so I can use that as a master of truth and to ease making backups.
Laptop
I sometimes want to code on the road, so I did a clone from the internal server and created a new branch called "laptop-branch". Unfortunately some directories MSVC++ version are different than from the Main Desktop environment. I just modified the files in the "laptop-branch" and committed them there.
Now I did a lot of changes while on vacation with my laptop, and want to push them to origin, but don't want the changes I made that were related to directories and compiler versions to be pushed back to origin.
What would be the best way to get this done?
I've been using SVN for some time now, and am pretty happy with how it works (but I can't say I'm an expert, and I haven't really done much with branches and merging). However an opportunity has arisen to put in some new practises on a new team and so I thought I'd take a look at DVCSs to see if it's worth making the jump.
The company I work for is a pretty standard company where we all work in the same location (or sometimes at home) and we want to keep a central store of all code.
My question is: if all you are doing with a DVCS is creating a central hub that everyone pushes their changes to, is there really any benefit to moving to a DVCS and its extra overheads in this sort of environment?
When SVN with merge tracking works, it's really nice, I love it. But it keeps getting twisted up. We are using TortoiseSVN. We continuously get the following message:
Error: Reintegrate can only be used if revisions 1234 through 2345 were previously merged from /Trunk to the reintegrate source, but this is not the case
For reference, this is the method we are using:
Create a Branch
Develop in the branch
Occasionally Merge a range of revisions from the Trunk to the Branch
When branch is stable, Reintegrate a branch from the branch to the trunk
Delete the branch
I Merge a range of revisions from the trunk to the branch (leaving the range blank, so it should be all revisions) just prior to the reintegrate operation, so the branch should be properly synced with the trunk.
Right now, the Trunk has multiple SVN merge tracking properties associated with it. Should it? Or should a Reintegrate not add any merge tracking info?
Is there something wrong with our process? This is making SVN unusable - 1 out of every 3 reintegrates forces me to dive in and hack at the merge tracking info.
In TFS we can find "compare" a file between 2 changesets. Is it possible to compare 2 changesets. Say take changeset "r" as reference and compare it with changeset "s" and find the files/folders which were added/removed/delted/edited ?