When deleting a branch from remote and local other people working in that repo are affected. If someone has the deleted branch local I guess they can push it back right?
How is this syncing handled?

When deleting a branch from remote and local other people working in that repo are affected. If someone has the deleted branch local I guess they can push it back right?

Yes, someone else who has the local branch, which got deleted in the remote, can push it to remote.

Git commit hash is actually a hash of the commit object that contains information including the hash of the commit before it. That is how the git commit history is generated.

Other people who also has the local branch will just need to set their remote tracking branch to the new "restored" branch, using the command:

git branch branch_name -u your_new_remote/branch_name
  • So how is that solved? – Jim yesterday
  • Are you asking for the command to change the upstream branch to be tracked? – junkangli yesterday
  • Ah so need for them to prune or something? – Jim yesterday
  • The prune option is to remove stale branches that no longer exist in the remote. The solution I provided replaces the old remote branch to the new one. So, people who want to continue working on that branch can use the command I provided, and people who do not want to continue working on that branch can prune the old branch. – junkangli yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.