Skip to main content

Timeline for Git pull after forced update

Current License: CC BY-SA 4.0

16 events
when toggle format what by license comment
Sep 9, 2021 at 9:49 history edited Florian CC BY-SA 4.0
Change branch name in example from master to main
Oct 15, 2019 at 12:34 comment added bmaupin @illis The branch referenced isn't a local branch, it's a remote branch (which is why it's prefixed with origin/
Oct 15, 2019 at 10:52 comment added iliis @bmaupin Check out the other branch first! If you want to go with option 1 for a any branch, you have to check it out first. git reset will operate on whatever branch you're currently on.
May 2, 2019 at 7:19 comment added AD7six @PlasmaBinturong No. git reset --soft origin/master will change commit history to match the remote and stage differences to the remote which then be committed. There'd be no need to rebase in that scenario (and you'd be prevented from doing so because of the uncommitted changes) because there's no difference in commit history. The two options are reset or rebase - not a combination of both. Please ask a question if your scenario is different than the one I've answered here.
Apr 30, 2019 at 16:36 comment added PlasmaBinturong So, to clarify, this is either: Option 1: reset --hard, or Option 2: reset --soft + rebase, right?
Jan 16, 2018 at 17:17 history edited Peter Mortensen CC BY-SA 3.0
Active reading. Unhid "<commit>" by encoding "<" as "&lt;" (see the original revision (<https://stackoverflow.com/revisions/0d2cf37c-3929-4104-aa72-78d522e38da1/view-source>).
Aug 30, 2017 at 15:18 history edited Donald Duck CC BY-SA 3.0
added 2 characters in body
Aug 30, 2017 at 13:48 review Suggested edits
Aug 30, 2017 at 14:28
Feb 1, 2017 at 20:18 comment added bmaupin Might be worth mentioning that if this is for a different branch: git reset origin/otherbranch --hard
Sep 21, 2016 at 10:58 review Suggested edits
Sep 21, 2016 at 14:18
Mar 22, 2012 at 6:59 comment added Tim @iblue When your colleague use `git reabse origin/master', and mean while, they already had some commit before, git will write your commit to the behind of their commit.
Mar 21, 2012 at 22:58 history edited AD7six CC BY-SA 3.0
minor change in voice; added 8 characters in body
Mar 21, 2012 at 22:56 vote accept iblue
Mar 21, 2012 at 22:51 history edited AD7six CC BY-SA 3.0
adding rebase warning note
Mar 21, 2012 at 22:46 history edited AD7six CC BY-SA 3.0
adding help
Mar 21, 2012 at 22:36 history answered AD7six CC BY-SA 3.0