Linked Questions

57 votes
2 answers
65k views

How to move master to HEAD?

* [971f835] (HEAD, original_idea) Now working here. Some comment 9 * [692b673] Some comment 8 * [3ebff62] Reverted to original idea. Some comment 7 | * [72ea01d] (master) Decided it wasn't worth the ...
martin's's user avatar
  • 3,905
26 votes
2 answers
13k views

How to recover commit from 'detached head state'?

I checked out another branch with updates then made a few changes, switched back to the main git and now the changes disappeared! Can I get them back? the terminal was basically: $ git commit [...
NoBugs's user avatar
  • 9,394
21 votes
6 answers
48k views

cannot push to github: everything up-to-date

On github, I forked an old version of another project. I made some changes and am trying to push them onto my fork on github. I commited the changes locally, then tried git push, but this simply tells ...
Kricket's user avatar
  • 4,149
33 votes
2 answers
17k views

git checkout my_branch vs. git checkout origin/my_branch

I was on branch1 when I checkout branch2 like this (both branches are existing). git checkout origin/branch2 then I got a detached head error: You are in 'detached HEAD' state. You can look around, ...
artm's user avatar
  • 17.6k
28 votes
1 answer
23k views

How to make submodule with detached HEAD to be attached to actual HEAD?

When I add a Git submodule to a Git repository like this, git submodule add ssh://server/proj1/ proj1 git submodule init git submodule update the added submodule will be in detached HEAD mode. I don'...
eonil's user avatar
  • 85.2k
6 votes
4 answers
9k views

How to retrieve the git branch name that was built by Jenkins when using inverse branch selection strategy?

We have one Jenkins job which builds every branch except master when there are new commits. This behavior can be configured via git plugin's 'choosing strategy:inverse' so that it listens to every ...
harish's user avatar
  • 1,886
17 votes
2 answers
2k views

Why does Git not store the branch name as part of the commit?

Please note: I'm not trying to restart the argument whether Mercurial or Git is better, I just have a technical question that I, as a Mercurial user, don't understand. I'm also not sure whether SO is ...
daniel kullmann's user avatar
6 votes
5 answers
15k views

Set master branch to latest tag

This is an example of how my git repo is right now: v1.0 v1.1 v1.2 | | | a - b - c | | master HEAD I usually commit, tag and push tags like ...
Peter's user avatar
  • 357
14 votes
2 answers
16k views

Git Push From One Remote Branch To Another Remote Branch

I am working with three forked versions of a source code. FYI I changed the names to not disclose identities/repos. Here is how it is laid out: MyMBP:~/Documents/_library$ git remote -v abc https://...
ajl123's user avatar
  • 1,242
13 votes
5 answers
9k views

Can't get automated release working with Hudson + Git + Maven Release Plugin

As the title says, I'm trying to get an automated release job working on Hudson. It's a Maven project, and all the code is in Git. Manually, I do the release on my personal machine like so: git ...
Christopher Maier's user avatar
11 votes
1 answer
8k views

HEAD detached at the HEAD commit id, what's the meaning?

git status says: HEAD detached at e1997bd and git rev-parse HEAD says: e1997bd What's the meaning of this? I was thinking HEAD detached means HEAD is not pointing to to branch tip.
KcFnMi's user avatar
  • 6,009
8 votes
3 answers
30k views

Git push doesn't fail but doesn't work

I'm using Git and I'm in front of a several problem: I can push, my coworkers can pull it, and the opposite. But the version which is on the remote is not up-to-date: if I write a TEST in the html, ...
RVA's user avatar
  • 95
9 votes
1 answer
9k views

Git detached head issue

I've read many posts related to this issue today( one useful one here: Fix a Git detached head? & Why did my Git repo enter a detached HEAD state?). Today I've been scratching my head. I'm not ...
user5858's user avatar
  • 1,191
2 votes
3 answers
21k views

Git checkout to recent commit

I have a total of 24 commits, and I had checkout to commit 15. How can I go back to my last commit? Note: I have run a lot of commits. For instances, git revert, git checkout, git reset. I don't know ...
Nimatullah Razmjo's user avatar
3 votes
1 answer
8k views

How to push with TortoiseGit

In push following errors occured git.exe push "origin" master:master To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See ...
freddiefujiwara's user avatar

15 30 50 per page