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?
Join Stack Overflow to learn, share knowledge, and build your career.
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
-
-
-
-
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
git fetch --all --prune
in their machines? – Jim yesterday