From: Erik V. <eri...@xs...> - 2011-07-21 09:46:48
|
OK, I have installed Git for Windows and am running Git Bash. 'git status' says: ---------------------------------------- # On branch master # Your branch and 'origin/master' have diverged, # and have 1 and 3 different commit(s) each, respectively. # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: data/1826/Game.xml # modified: data/1870/Game.xml # modified: rails/algorithms/NetworkTrain.java # modified: rails/algorithms/RevenueAdapter.java # modified: rails/algorithms/RevenueCalculator.java # modified: rails/algorithms/RevenueCalculatorMulti.java # modified: rails/algorithms/RevenueCalculatorSimple.java # modified: rails/game/Train.java # modified: rails/game/TrainI.java # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # rails/algorithms/RevenueCalculatorMultiHex.java no changes added to commit (use "git add" and/or "git commit -a") ------------------------------------------------- 1. The "modified" files are Stefan's updates. Why are these marked as "Changes not staged for commit"? Because these are in a branch? What am I supposed to do? 2. What is the real status of the "Untracked" file RevenueCalculatorMultiHex.java? This is the file for which Egit showed a merge conflict. Indeed the file icon is marked "?" so it's currently untracked. What should I do? 'git push' says: ----------------------------------------------- ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'ssh://evos:<password>@rails.git.sourceforge.net/gitroot/rails/rails' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. Aborting ---------------------------------------------- So I tried 'git pull', which says: ----------------------------------------------- error: Your local changes to the following files would be overwritten by merge: data/1826/Game.xml data/1870/Game.xml rails/algorithms/NetworkTrain.java rails/algorithms/RevenueAdapter.java rails/algorithms/RevenueCalculator.java rails/algorithms/RevenueCalculatorMulti.java rails/algorithms/RevenueCalculatorSimple.java rails/game/Train.java rails/game/TrainI.java Please, commit your changes or stash them before you can merge. error: The following untracked working tree files would be overwritten by merge: rails/algorithms/RevenueCalculatorMultiHex.java Please move or remove them before you can merge. -------------------------------------------------- So it seems that Stefan's changes are already in my repository, but are nevertheless in the way of pulling the very same changes into my repository (again??). Before I start trying lots of other things: is there an easier way out than to do it all over again, as Brett suggested? Erik. > -----Original Message----- > From: Erik Vos [mailto:eri...@xs...] > Sent: Wednesday, July 20, 2011 11:47 PM > To: 'Development list for Rails: an 18xx game' > Subject: Re: [Rails-devel] Git troubleshooting [was: Git repository is now > available.] > > My HEAD is at dab610 (parent fd4a38) and includes my commit, but not > Stefan's. > I'll try again tomorrow. > > Erik. > > > -----Original Message----- > > From: brett lentz [mailto:bre...@gm...] > > Sent: Wednesday, July 20, 2011 11:30 PM > > To: Development list for Rails: an 18xx game > > Subject: Re: [Rails-devel] Git troubleshooting [was: Git repository is > > now available.] > > > > One thing you can try is clone a new repository. Then, export your > > commits as a diff that can be applied to the newly cloned tree. Once > > done, you can try pushing from a fresh tree. > > > > While Git tries to allow your to be ambigious and tries to do the > > right thing, you can also be explicit with your pushes: > > > > $ git push origin master:refs/heads/master > > > > This says "Push local master branch to refs/heads/master on origin." > > > > According to the GitWeb, HEAD in the repo should be at d123b894c. > > > > ---Brett. > > > > > > On Wed, Jul 20, 2011 at 2:27 PM, Erik Vos <eri...@xs...> wrote: > > > Something has worked: Team|Merge on FETCH_HEAD has updated my > > working > > > copies with Stefan's changes. > > > All these changes have disappeared from the Synchronize view, except > > > RevenueCalculatorMultiHex.java, which now shows a merge conflict, > > > even though the local and remote sources are identical. "Mark as > merged" > > > does nothing. > > > > > > And I still can't push, with the same error message. > > > > > > Erik. > > > > > >> -----Original Message----- > > >> From: Erik Vos [mailto:eri...@xs...] > > >> Sent: Wednesday, July 20, 2011 11:11 PM > > >> To: 'Development list for Rails: an 18xx game' > > >> Subject: Re: [Rails-devel] Git troubleshooting [was: Git repository > > >> is now available.] > > >> > > >> Hmm, now *I* seem to be royally stuck. > > >> > > >> I have prepared and committed some changes (in master) and tried to > > >> push this commit, but it keeps being rejected with a message > > >> "non-fast > > > forward". > > >> Google tells me that this means that there is stuff waiting to be > > >> pulled > > > first, > > >> so I tried that (not sure if I started with fetch or with pull, > > >> tried > > > both), but I > > >> keep getting "No ref to fetch from origin - everything up to date". > > >> Merge attempts fail as well. My working copy of 1826/Game.xml > > >> (just one file changed by Stefan) is not updated. > > >> > > >> I suppose that Stefan's branching is somehow related to this problem. > > >> Why has this H_train branch been pushed at all? For now I'm only > > >> interested > > > in > > >> what's in the master branch. > > >> I would think we can better refrain from branching until the normal > > > (master) > > >> pushes and pulls have proved to work at all sides. > > >> > > >> I'll keep trying, and perhaps I'll have to try to use git on the > > >> command > > > line to > > >> get this fixed. > > >> > > >> Anyhow, it's clear that Git is boggling my mind... Perhaps a fresh > > >> look tomorrow will help. But PLEASE - keep it simple initially! > > >> > > >> Erik. > > >> > > >> > -----Original Message----- > > >> > From: Stefan Frey [mailto:ste...@we...] > > >> > Sent: Wednesday, July 20, 2011 5:03 PM > > >> > To: Development list for Rails: an 18xx game > > >> > Subject: Re: [Rails-devel] Git troubleshooting [was: Git > > >> > repository is now available.] > > >> > > > >> > Brett: > > >> > sorry I was using the wrong wording below (still kept somehow in > > >> > my subversion-world, where a branch is a copy of the trunk). > > >> > > > >> > I did not clone the local repo, instead I created a branch inside > > >> > the same repo. So my actual workflow was the one you suggested > > below. > > >> > > > >> > So I have two branches shown in the git explorer of egit: master > > >> > and > > >> h_train. > > >> > > > >> > Anyhow I tested things again in the last half hour and it did not > > >> > work > > >> first, but > > >> > now it worked out of the blue. > > >> > > > >> > Have you changed anything on the settings or did I torture egit > > >> > for so > > >> long, > > >> > that it had pity with me. > > >> > > > >> > Stefan > > >> > > > >> > > > >> > > > >> > > > >> > On Wednesday, July 20, 2011 04:45:02 pm brett lentz wrote: > > >> > > Comments inline... > > >> > > > > >> > > On Wed, Jul 20, 2011 at 4:39 AM, Stefan Frey > > >> > > <ste...@we...> > > >> > wrote: > > >> > > > Actually I had to use the push uri: > > >> > > > ssh://{username}@rails.git.sourceforge.net/gitroot/rails/rail > > >> > > > s > > >> > > > > > >> > > > Using the git protocol was not possible, as egit complained > > >> > > > that it does not support a username. > > >> > > > > >> > > Correct. To be able to push changes, your remote uri needs to > > >> > > be the ssh uri. > > >> > > > > >> > > You can modify this setting on the fly, and don't need to > > >> > > re-clone the repository. The "git config" CLI commands can > > >> > > update any repository setting. > > >> > > > > >> > > > I prefer not to use the synchronize perspective with git, as > > >> > > > I wonder what it actually shows, as there are now two states > > >> > > > of changes (changes not committed, changes committed but not > > >> > > > pushed > > >> > yet). > > >> > > > > >> > > I'm not yet familiar with EGit, so most of the following > > >> > > information will be based on my knowledge of the CLI tools. > > >> > > > > >> > > > So my intended workflow to implement a new feature was: > > >> > > > A) Create a branch for that feature locally by cloning my > > >> > > > local master which is itself a clone of the remote master. > > >> > > > B) Commit the changes in the local branch. > > >> > > > C) Push/merge those changes into my local master. > > >> > > > D) Push the changes from the local master into the remote master. > > >> > > > > >> > > Creating two local repositories is unnecessary and might be > > >> > > adding extra complications to your workflow. > > >> > > > > >> > > Let's see if we can get the simple use case working, then you > > >> > > can decide if you need more. > > >> > > > > >> > > Try doing this: > > >> > > > > >> > > 1. Create a topic branch. > > >> > > 2. Work as needed in the topic branch, making local commits > > >> > > when it makes sense. 3. When you've got an amount of work > > >> > > that's ready to push, update your local master and then merge > > >> > > your topic branch to your > > >> > local master. > > >> > > 4. Push your changes to the remote repository. > > >> > > > > >> > > Let's even save rebasing for later. > > >> > > > > >> > > > Unfortunately I was not able to push the changes to the > > >> > > > master branch, I got a rejected error message for this (both > > >> > > > on dry run and real). But my local master is up-to-date with > > >> > > > the repo > > master. > > >> > > > > >> > > If you post the error message, it would help. > > >> > > > > >> > > The most common reasons for a failed push are: > > >> > > > > >> > > 1. Authentication and permissions problems (including using the > > >> > > wrong remote.origin.url. > > >> > > 2. Local branch being out of sync with remote branch. (try a > > >> > > git pull, then retry your push.) > > >> > > > > >> > > Unline SVN, Git won't let you push changes if your local tree > > >> > > is out of sync with the remote tree. You need to pull any > > >> > > remote changes into your local tree, resolve any merge > > >> > > conflicts (if > > >> > > any) locally, then push your changes. > > >> > > > > >> > > > However I was able to push my branch H_train into the repo > > >> > > > and was able to push my committed changes there. > > >> > > > > > >> > > > My ref spec for the push to the master is: > > >> > > > refs/heads/master:refs/heads/master > > >> > > > > >> > > This looks correct. > > >> > > > > >> > > It would be more useful to diagnose the issue to do this: > > >> > > > > >> > > $ git fetch > > >> > > $ git status > > >> > > $ git branch -vv > > >> > > $ git diff origin/master master --stat > > >> > > > > >> > > The fetch will update your remote refs without changing your > > >> > > working copy. Git pull simply is a shortcut to running fetch > > >> > > then either merge or rebase (depending on chosen options). > > >> > > > > >> > > The output of the status, branch, and diff commands will tell > > >> > > you how out of sync you are with the remote side, often telling > > >> > > you how many commits ahead or behind you are. > > >> > > > > >> > > > What have I done wrong? > > >> > > > Maybe it is better to wait for Brett to help here, I do not > > >> > > > want to break anything and he has daily working knowledge with > git. > > >> > > > > > >> > > > Stefan > > >> > > > > >> > > ---Brett. > > >> > > > > >> > > > On Wednesday, July 20, 2011 11:12:44 am Erik Vos wrote: > > >> > > >> See below for my findings > > >> > > >> > > >> > > >> > -----Original Message----- > > >> > > >> > From: Stefan Frey [mailto:ste...@we...] > > >> > > >> > > > >> > > >> > Brett or Erik: > > >> > > >> > I believe I am doing something wrong or something is not > > >> > > >> > setup correctly, > > >> > > >> > > >> > > >> but > > >> > > >> > > >> > > >> > I do not get the push working after the commit. > > >> > > >> > > > >> > > >> > I did setup a complete new workspace for git, cloned > > >> > > >> > remote, changed , committed, then pushed to remote. > > >> > > >> > All steps worked, except the final push. > > >> > > >> > > >> > > >> I did the same thing, and it all appears to have worked. > > >> > > >> I'm not happy with the way Egit reports a successful push: > > >> > > >> the synchronization view is not updated (unlike Subversive, > > >> > > >> which cleaned up that view after a commit). Basically I have > > >> > > >> to conclude success from the absence of error messages; I > > >> > > >> would have preferred > > >> > some positive message. > > >> > > >> > > >> > > >> > The error message I get is that the push is not permitted. > > >> > > >> > > > >> > > >> > My thoughts are: > > >> > > >> > > > >> > > >> > I have not setup a specific push-URI, only used the > > >> > > >> > sourceforge link > > >> > > >> > git://rails.git.sourceforge.net/gitroot/rails/rails > > >> > > >> > > >> > > >> Same as I did, except that I had inserted my username, as > > >> > > >> per the Egit help info > > >> (git://ev...@ra.../gitroot/rails/rails). > > >> > > >> I wonder: could and should I also insert my password? Now > > >> > > >> I'm asked to type my Sourceforge password *every* time I > > >> > > >> access remote (Subversive only required it once per Eclipse > session). > > >> > > >> I could not find a place to configure that either. > > >> > > >> > > >> > > >> > During the clone the fields for authentication were grayed out. > > >> > > >> > > >> > > >> Can't remember. > > >> > > >> > > >> > > >> > During the push I never got asked for my user-account or > > >> > > >> > password on sourceforge. > > >> > > >> > > >> > > >> I think I was asked for my password only, as I had included > > >> > > >> mu username in the URL. > > >> > > >> > > >> > > >> > I was not able to locate anywhere in all those Eclipse > > >> > > >> > dialogs where I > > >> > > >> > > >> > > >> might be > > >> > > >> > > >> > > >> > able to setup my account. > > >> > > >> > > >> > > >> The only place I found was in the Push Wizard > > >> > > >> (Team|Remote|Push), but I haven't used the Custom part of > > >> > > >> that > > either. > > >> > > >> > > >> > > >> > Could you please provide help? > > >> > > >> > > >> > > >> Unfortunately I can't speak the final word on this matter. > > >> > > >> Let's together try to find what works best. > > >> > > >> > > >> > > >> Erik. > > >> > > >> > > >> > > >> > > >> > > >> ------------------------------------------------------------ > > >> > > >> -- > > >> > > >> --- > > >> > > >> -- > > >> > > >> ----- > > >> > > >> --- --- 10 Tips for Better Web Security Learn 10 ways to > > >> > > >> better secure your business today. Topics covered > > >> > > >> include: Web security, SSL, hacker attacks & Denial of > > >> > > >> Service (DoS), private keys, security Microsoft Exchange, > > >> > > >> secure Instant Messaging, and much more. > > >> > > >> http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > >> > > >> _______________________________________________ > > >> > > >> Rails-devel mailing list > > >> > > >> Rai...@li... > > >> > > >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > >> > > > > > >> > > > ------------------------------------------------------------- > > >> > > > -- > > >> > > > --- > > >> > > > -- > > >> > > > ----- > > >> > > > ----- 10 Tips for Better Web Security Learn 10 ways to better > > >> > > > secure your business today. Topics covered > > >> > > > include: Web security, SSL, hacker attacks & Denial of > > >> > > > Service (DoS), private keys, security Microsoft Exchange, > > >> > > > secure Instant Messaging, and much more. > > >> > > > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > >> > > > _______________________________________________ > > >> > > > Rails-devel mailing list > > >> > > > Rai...@li... > > >> > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > >> > > > > >> > > --------------------------------------------------------------- > > >> > > -- > > >> > > --- > > >> > > -- > > >> > > ----- > > >> > > --- 10 Tips for Better Web Security Learn 10 ways to better > > >> > > secure your business today. Topics covered > > >> > include: > > >> > > Web security, SSL, hacker attacks & Denial of Service (DoS), > > >> > > private keys, security Microsoft Exchange, secure Instant > > >> > > Messaging, and much > > >> > more. > > >> > > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > >> > > _______________________________________________ > > >> > > Rails-devel mailing list > > >> > > Rai...@li... > > >> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > >> > > > >> > > > >> > > > -------------------------------------------------------------------- > > > -- > > > ------ > > >> -- > > >> > 10 Tips for Better Web Security > > >> > Learn 10 ways to better secure your business today. Topics > > >> > covered > > >> include: > > >> > Web security, SSL, hacker attacks & Denial of Service (DoS), > > >> > private keys, security Microsoft Exchange, secure Instant > > >> > Messaging, and much > > >> more. > > >> > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > >> > _______________________________________________ > > >> > Rails-devel mailing list > > >> > Rai...@li... > > >> > https://lists.sourceforge.net/lists/listinfo/rails-devel > > >> > > >> > > >> > > > -------------------------------------------------------------------- > > > -- > > > ------ > > > -- > > >> 10 Tips for Better Web Security > > >> Learn 10 ways to better secure your business today. Topics covered > > > include: > > >> Web security, SSL, hacker attacks & Denial of Service (DoS), > > >> private keys, security Microsoft Exchange, secure Instant > > >> Messaging, and much > > more. > > >> http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > >> _______________________________________________ > > >> Rails-devel mailing list > > >> Rai...@li... > > >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > -------------------------------------------------------------------- > > > -- > > > -------- > > > 10 Tips for Better Web Security > > > Learn 10 ways to better secure your business today. Topics covered > > include: > > > Web security, SSL, hacker attacks & Denial of Service (DoS), private > > > keys, security Microsoft Exchange, secure Instant Messaging, and > > > much > > more. > > > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > > _______________________________________________ > > > Rails-devel mailing list > > > Rai...@li... > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > ---------------------------------------------------------------------- > > -------- > > 10 Tips for Better Web Security > > Learn 10 ways to better secure your business today. Topics covered > include: > > Web security, SSL, hacker attacks & Denial of Service (DoS), private > > keys, security Microsoft Exchange, secure Instant Messaging, and much > more. > > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ---------------------------------------------------------------------------- -- > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |