I have downloaded the dev site locally on Acquia dev desktop. Performed update of Drupal core. Opened in git bash when I run "Git branch" it showed detached head from"XYZ". I know a solution for this is creating a new file and merging to master. But what if i don't want to merger to master how do I push to tag in dev and not master.
Asked
Active
Viewed 60 times
2 Answers
1
Following Aquia documentation, you could simply create your dev branch and push it:
git checkout -b [branchname]
# with Git 2.23+
git switch -c [branchname]
git push origin [branchname]
Check also if dev
already existed with git branch -avv
. The git switch
command would automatically track origin/dev
, as I mentioned here.
![](../../users/profiles/6309.webp)
VonC
- 1,042,979
- 435
- 3,649
- 4,283
-
Does this creates a new branch? Because I want to push changes to the same tag which I pulled data from the cloud. – sp31 Nov 19 '19 at 12:46
-
@sp31 A tag is immutable: you do not push to a tag. You add commits to a branch. If the remote branch origin/dev exists (git branch -avv), then you create a local branch, which will automatically track origin/dev, and push there. – VonC Nov 19 '19 at 13:01
-
Thank you for more clarity. So do I run- git push origin/dev – sp31 Nov 20 '19 at 06:28
-
@sp31 You do not push a remote branch, only a local one: git push -u origin dev: that will update origin/dev. – VonC Nov 20 '19 at 06:36
0
If what you want to create is tags and have them on a remote, you can do so very easily:
git tag tag1
git tag tag2
git tag tag3
git push some-remote tag1 tag2 tag3
You will still be in detached HEAD state.
![](../../users/profiles/2437508.webp)
eftshift0
- 16,836
- 2
- 23
- 36
-
-
don't understand the question. They are 3 different tags, all pointing to the same revision. – eftshift0 Nov 19 '19 at 13:24
-
... and when you push a tag, I don't think you can give it another name (unlike branches where you can push to branches with different names). – eftshift0 Nov 19 '19 at 13:29
-