Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How move HEAD on Remote Repository?

Hi All,

In origin, I have two branches - default and master.

Currently, the HEAD in origin points to the branch named 'default', but the branch called master is defined as the MAIN branch.

So, how can I move the HEAD on the origin from the default branch to the master branch?

Thank you!

 

 

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 02, 2022

Hi @Dmitry Leyzerovich and welcome to the community!

Could you please provide some more details as to where exactly you see the HEAD of the remote repo?

Are you perhaps referring to the reference located in .git/refs/remotes/origin/HEAD in your clone of the repo?

If so, this reference is set when you clone the repo, and a git fetch doesn't update it if you change the main branch after you clone.

If you changed the main branch after cloning the repo, you can use the following command to update this specific ref locally:

git remote set-head origin -a

This will work if the ref refs/remotes/origin/master exists already locally (otherwise you need to fetch it first).

See here for reference: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-headem

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events