MAX
MAX

Reputation: 53

how to I push a specific commit using gitkraken UI

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.

Upvotes: 2

Views: 1156

Answers (2)

GWorking
GWorking

Reputation: 4341

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

Upvotes: 2

kowsky
kowsky

Reputation: 14539

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

Upvotes: 0

Related Questions