First of all, would you like to send us report generated by utility
https://github.com/makelinux/git-wizard ?
The second, you can save your commits with command "git format-patch ....".
But your valuable commits, not theirs. And save changes: "git diff HEAD >
changes.patch"
Or, the third, you can create your branch from current state: git branch
MY; and stash your changes "git stash push"

Then you can safely pull, rebase and merge if need.

Regards

On Mon, Apr 27, 2020 at 5:48 AM SJW <shannon.whi...@gmail.com> wrote:

> I keep trying to learn and use git but I keep screwing up my work -
> overwriting changes and creating duplicate efforts.
>
> I made some changes today, but was on the wrong branch - when trying to
> change branch I screwed up
> I made the changes again and then tried to push to master and I get this:
>
> $ git push origin master
> To https://gitlab.com/SJWGitLab/absee.net.au.git
>  ! [rejected]        master -> master (non-fast-forward)
> error: failed to push some refs to '
> https://gitlab.com/SJWGitLab/absee.net.au.git'
> hint: Updates were rejected because the tip of your current branch is
> behind
> hint: its remote counterpart. Integrate the remote changes (e.g.
> hint: 'git pull ...') before pushing again.
> hint: See the 'Note about fast-forwards' in 'git push --help' for details.
>
>
> It says do a git pull BUT, my understanding is that doing a pull will
> overwrite my code with the origin and delete my recent changes.
>
> I did a git diff but it gave me nothing... I dont want the origin to be
> the master - my local is the master...
>
> I'm having a real hard time with git and dont understand how it is so
> popular - it has added an extra layer of complexity and confusion on top of
> managing code that is creating so much rework and recoding... What am I
> missing?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/fcab0336-1174-44f7-955b-cd7ce84608e3%40googlegroups.com
> <https://groups.google.com/d/msgid/git-users/fcab0336-1174-44f7-955b-cd7ce84608e3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Constantine Shulyupin

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAE7jHC_FVMbCR1j5m3pYe2yBa5_VX-sm%3DQt5bcmR9jnergeE7g%40mail.gmail.com.

Reply via email to