git-2.16.2 on linux
I'm not terribly experienced with git push, so please bear with...
I made changes to a clone which was created from origin master. I want to push those changes to origin master without merging with what's there. I tried git push --force
but that didn't seem to work even though the messaging seems to indicate that it did...
--> git push --force
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 597 bytes | 597.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
To /proj/projects/git_repos/mytool.git
+ eafc0ab...3155ce8 master -> master (forced update)
I say it didn't work because when I now do a git clone
of origin master to make a new repo with the changes, the changes aren't there.
The reason I tried the --force
is that I want all my local (committed) changes to basically clobber whatever's in origin master. I don't want to merge with whatever's there, although I can see why that's an important thing to be able to do in some circumstances. I'm basically looking for a shortcut around doing the git pull --rebase
and all the merging (accepting everything I have locally and rejecting everything else), git add
, git rebase --continue
, etc... . I just want my local changes to replace whatever's in the origin master.
If there is a shortcut outside of git push --force
that I can use to to avoid all the merging and just accept the local changes, that's good, because it'll save the history.
Thanks for any help