Reputation: 27123
I have made checkout to my previous version in my repo.
git checkout 9dc64fa
Then I have made few changes and made few commits.
Right now when I check status it says:
# HEAD detached from 9dc64fa
How do I need to make push to update data on the server with new commit?
Upvotes: 0
Views: 3466
Reputation: 42094
Commits are intended to go on a branch. This way you can easily get to its tip, where all the fun happens, with a simple command:
git checkout <branch_name>
In your situation, you've made commits from an unnamed ref (to which you refereed by SHA-1), and git has no way to derive a branch name from that. To push as usual, first create a branch like this:
git checkout -b <new_branch_name>
If you actually wanted to commit to an already existing branch, you can still overwrite it, but do make sure that's really want you intend to do (check the checkout
subcommand usage, or just delete the target branch beforehand).
Upvotes: 2