Open andrear2 opened 10 years ago
Da http://stackoverflow.com/questions/19474186/egit-rejected-non-fast-forward The problem is the branch that you pulled code from has since changed on the remote repository. You need to (now) merge those changes at the remote repository into your local changes before you can commit.
The steps: 1) Configure the 'fetch' to fetch the branch you originally pulled from. 2) Fetch the remote branch. 3) Merge that remote branch onto your local branch. 4) Commit the (merge) change in your local repo. 5) Push the change to the remote repo.
In detail: 1) In eclipse, open the view 'Git Repositories'. 2) Ensure you see your local repository and can see the remote repository as a subfolder. In my version, it's called Remotes, and then I can see the remote project within that. 3) Look for the green arrow pointing to the left, this is the 'fetch' arrow. Right click and select 'Configure Fetch'. 4) You should see the URI, ensure that it points to the remote repository. 5) Look in the ref mappings section of the pop-up. Mine was empty. This will indicate which remote references you want to fetch. Click 'Add'. 6) Type in the branch name you need to fetch from the remote repository. Mine was 'Master' (btw, a dropdown here would be great!!, for now, you have to type it). Continue through the pop-up, eventually clicking 'Finish'. 7) Click 'Save and Fetch'. This will fetch that remote reference. 8) Look in the 'Branches' folder of your local repository. You should now see that remote branch in the remote folder. Again, I see 'master'. 9) Right-Click on the local branch in the 'Local' folder of 'Branches'. Select 'Merge', and then select the remote branch. 10) Process through the merge. 11) Commit any changes to your local repository. 12) Push your changes to the remote repository.
Problema di fare il push se due persone stanno modificando la repository. Il primo riesce a pushare, al secondo dà l'errore push non-fast-forward.