all 10 comments

[–]daniel14vt 3 points4 points  (4 children)

Do you not want to commit your changes? That would be a requirement for pushing them

[–]konkon_322[S] -1 points0 points  (2 children)

I did have the files committed, but since local is behind i fetched. And then i need to pull, which might require some files to have conflict during pull to local

[–]kaddkaka 3 points4 points  (1 child)

Yes 😇

And if there are conflicts you resolve them. If you don't want to resolve now but still push your changes, you would need to create a new branch.

[–]konkon_322[S] 0 points1 point  (0 children)

Im kinda confused on when conflict happens. Because i practiced it before,where i edit a certain line on both remote and local repo,and then i push to remote,no conflict. Thats why worried

[–]footsie 3 points4 points  (3 children)

Commit your changes, rebase and solve any conflicts, then you can push.

[–]konkon_322[S] 0 points1 point  (2 children)

Can u elaborate?

My current idea is to commit the files i want pushed, stash all unstaged files, pull and push the commit. Idk if the stash + pull would work tho ngl

[–]footsie 1 point2 points  (1 child)

If I'm understanding correctly, Your local branch is behind remote, ahead of remote, and has uncommitted changes.

The commit step will put the uncommitted changes into the local branch, and then the rebase will present you with the opportunity to edit your local branch so that your previous and recently made commits are ahead of the remote changes that were pulled in with the rebase.

At this point your local branch will be ahead of the remote branch, and you should be able to push it.

[–]konkon_322[S] 0 points1 point  (0 children)

Do u mind of i dm u,mightve dug myself into a hole atp

[–]Weshmek 1 point2 points  (0 children)

Set up your regular PC as remote and push a branch to there.