Tag: commit

Undo last commit/merge

I have messed up my git repo a little. I worked on a feature in a separate branch. After finishing the work, I switched to the master to merge it into, but my partner pushed a few files which came into conflict with mine. After the merge, the conflict and pushing the new changes, I […]

Remove a merge commit, keeping current changes

We have had a small problem in our team. One dev had to include some changes in our development branch. Before doing so, he accidentally merged a feature branch (which shouldn’t be merged then) and kept on working over those changes, generating a couple of commits after the merge. Now we want to keep those […]

git clone and checkout in a single command

The following is the command I use to checkout a specific commit. git clone git://repo.git/repo123 git checkout <commitID> I want to do the above in one step – using a git clone command only. The reason why I want to do this is, repo123 is very huge. So checking out the commit I want will […]

How to copy a commit from one branch to another in git without any merging?

I have 2 branches a master and an experimental. A shown: master-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-Y \ -x-x-x-x My experimental is quite outdated and i was hoping to update it by simply copying the last commit in the master branch (Y) to experimental: master-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-Y \ -x-x-x-x-Y If possible, I don’t want to have to do any merging I want […]

How can I undo my last git add/commit?

I edited a file and did: git add file.py git commit -m ‘fixed bug’ I then edited another file and performed a minor bug fix. I don’t want two commits, one after the other, showing ‘bug fix’. I want one commit with ‘bug fixes’. How can I undo the last add/commit and change the first […]

How do I merge a single commit?

Sometimes I’m working with several branches at once. Say I have branches called master, release-1.1, and experimental. I create a new file or make a change in experimental and I want that one single change to apply to the other branches. Can I do this in git? If I simply merge the commit into another […]

Change the wrong commit message in Git

This question already has an answer here: How to modify existing, unpushed commits? 27 answers

Will a commit be garbage collected if it's referred to by tag but not by branch?

I’ve got an annotated tag referring to a commit (does it matter if it is annotated?) and no branch referring there. Will the commit be garbage collected after some time?

Git push vs. git push heroku master

I just moved from a pc laptop to a Mac, and I’ve noticed a curious difference in how my git commands respond. Before, I would do the following: git add . git commit -m “These are my new changes” git push # This would update my repo on github {enter password} git push heroku master […]

Close Jira issue via Git commit

Does anyone know if it’s possible to change the status of a Jira issue using a Git commit? I am using Jira and Git with the Jira Git plugin and I know I can reference an issue by just adding the name in the commit but I thought a commit message like “ISSUE-1 #close” would […]

Git Baby is a git and github fan, let's start git clone.