Comments (3)
Did this work in 0.40.2? My suspicion is that it did, but only as long as you didn't have to force-push. Any attempt to force-push would have resulted in the same "stale info" error.
For context, there are two PRs that broke this workflow in different ways. The first is #3387, which removed the logic to ask for force-pushing when the server rejected the push. We still need this logic for branches whose upstream is not stored locally, because in that case we can't tell ahead of time whether force-pushing is going to be needed. The second is #3528, which would always ask for force-pushing if the branch shows a ?
. This is wrong, we need to start with a normal push in that case, and then only ask for force-push if the server rejected it.
Fixing these two problems (or actually, just the second) will make it work again if a normal push is sufficient. However, it will still not fix the "stale info" error that you get when you do in fact need to force-push, and I suspect that this problem was always present for such branches. It is caused by the --force-with-lease
argument that lazygit uses to force-push; I think this will have to be just --force
in the case that the remote branch is not stored locally.
Draft PR is here if you want to test it: #3619. It fixes the two problems mentioned above, but not the "stale info" problem yet. Just wanted to confirm my theories before I spend more time on this.
from lazygit.
I did some more testing and concluded that force-pushing to a branch whose remote is not stored locally can never have worked. I updated #3619 to fix that problem too.
from lazygit.
However, it will still not fix the "stale info" error that you get when you do in fact need to force-push, and I suspect that this problem was always present for such branches.
Can confirm this was the case. I just force push to these kinds of branches quite rarely, and when I do I use the CLI execute window in lazygit 😄.
I've tested your fix at a functional level and it fixes the problem. Thanks again.
from lazygit.
Related Issues (20)
- menuFromCommand support user input to filter menu
- show commits difference between 2 branches (git log branchA...branchB) HOT 2
- Lazygit exits when it's not in a Git repo HOT 2
- Commit hash color incorrect after merge with main HOT 1
- Files panel is empty when (many) new/changed files exist HOT 1
- Custom command and custom command HOT 6
- New "notARepository" strategy: recurse
- Add grouping for tags HOT 2
- Rewording last commit freezes when GPG passphrase is needed in CLI HOT 1
- Emojis in Commit Messages can Break UI Layout and Affect Displayed Diffs
- Crash when filtering by author HOT 3
- Recent repositories HOT 12
- Add ability to config regexp in commit message for links
- Support terminal hyperlinks to allow opening diff lines in editor when using delta pager HOT 12
- [Request] Create go template variable for selected items in files for example
- `nvim-remote` edit preset uses the hard coded `q` key
- Add an option to hide the detail of git merge
- implement github release HOT 6
- Range select with more than just up/down arrows HOT 1
- `M` no longer in yellow to signify staged modifications/commit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazygit.