2

I have done a feat,but I commit it for four times,some logic package,html...

but now I want to push the third commit (all the html).

how do I do in gitkraken?

May be I can use Cherry pick ?

can anyone tell me how to push just one commit when you have a lot of commit in local repo.

MAX
  • 53
  • 9

2 Answers2

1

Actually, if this can be done in git, as said here How can I push a specific commit to a remote, and not previous commits?, it can be done in gitKraken.

But I can't see a graphical way to do it, so I assume it can be done by opening the gitkraken terminal and follow the comments of the link

GWorking
  • 4,011
  • 10
  • 49
  • 90
0

When you push, you always push the current state of a branch, not individual commits. If you only want to add a certain commit to another branch, cherry-pick is an option: Check out the branch that you want to "add" the commit to, and use git cherry-pick <commit-sha> or the respective gk feature (right clickt commit -> Cherrypick commit). When you push, the remote branch will be updated and will contain a commit containing the cherry-picked changes.

But why would you only want to use a single commit of a feature? Are you sure you do not want to merge the whole feature branch? Further information about your workflow and branching model would help here.

I suggest you read some beginners literature on how git works. You can find links in the git tag info, like the git pro book

kowsky
  • 12,647
  • 2
  • 28
  • 41
  • One of the reasons to push a single commit when you have several local commits on the machine is when one of them contains heavy data files. That's the reason I'm here actually. You might want to push instantly the commits containing only text files, and push later the commit containing a large file (say a .hdf5 database). GitKraken's push button will try to push everything (starting from the oldest) and take more time than you would like. – Guimoute Nov 12 '21 at 16:15
  • In Azure each push can be a separate "change". So a reviewer can review only a bunch of commits at a time, not only the whole branch. Like push a change for updating a library, then push another change to add the new popup you wanted. So you can review change by change – marcellsimon Jul 08 '22 at 08:17