Please help.
I'm always having a difficulty with pushing my changes to an existing remote repository where the revision number is newer. i.e. someone has pushed to that repository after I last pull.
I'm using ubuntu 14.04
, and netbeans
and mercurial
and meld
and my project is a php application using laravel framework.
my current solution is,
tip
tag;alt
+shift
+f
(Format) in each of the files that differ, in both directories, so that I could remove the unnecessary whitespaces and I could easily see the changes (when I compare the two directories again in meld) with proper indentation and clearer linebreaks;tip
equal to the latest revision in the remote repository;I don't want to stay using this solution since it requires also that you have a second backup repository (in other words, storage capacity problems). Please help me find another solution.
If I do everything different, like, first, pulling the latest changes (by my colleagues) from the remote repository: I am getting an error:
abort: outstanding uncommitted changes
If I push first: the error is:
abort: push creates new remote heads on branch 'default'!
(did you forget to merge? use push -f to force)
then sometimes, if I pull using terminal, it requires me to merge. and it is very difficult to merge in terminal when you have no control which files are you going to merge first (the terminal opens the meld comparison tool for every changed files alphabetically),
and sometimes you have to apply "Format" first to each files to easily understand the objective of the changes performed.
but if you quit the merge, it would assume that you have successfully merged the files (or not? CMIIW.)
In short, Mercurial is already giving you the hint. You can pull in remote changes anytime. But you can't merge them with your changes, if you have uncommitted changes in your working directory.
So just commit those (or shelve them, if you're not done yet), do a merge, resolve any conflicts, and commit the merge. Then you can push everything to the remote server.