Reputation: 4044
I cloned a project and I've been pushing my changes to a branch. Now I want to push all the changes since the clone (not only the last commit) to a new branch I'll create; but when I go to VCS->GIT->Push in the right panel I see that only the changes made since the last push are selected. How can I tell intellij to push all changes since the clone?
Upvotes: 0
Views: 259
Reputation: 7528
The push dialog show only commits that are not present in the remote repository. Effectively, that is only your last commit.
Any branch you create on the remote from your current HEAD will contain all the commits you did since clone anyway.
Upvotes: 1
Reputation: 31936
VCS > Git > Push will show all un-pushed changes. It will not show pushed changes, even ones pushed to/on another branch. To view all commits (regardless of their being pushed or not) you can:
Now I want to push all the changes since the clone (not only the last commit) to a new branch I'll create
You'll need to merge the changes from the original branch to the new branch. You can do this in two ways.
Switch to the target branch (the new branch you want to merge the changes to). In the bottom right of the IntelliJ IDEA window, open the VCS dialog by clicking the double arrows:
In the popup, select {source branch} > merge. For example, here I'm merging from "my-work-branch" branch to "the-target-branch" branch:
You should then get a confirmation of the merge.
All changes made on the source branch will not be merged onto the target branch. You can then push those.
Switch to the target branch (the new branch you want to merge the changes to). From the Log tab of the Version Control tool window (see above), select the individual commits form the source branch you want to merge to the new branch. (Hold down the Ctrl key to select multiple commits, or the Shift key to select a consecutive group). Click the cherry pick button from the Version Control tool bar (or right click and select it from the context menu).
Upvotes: 1