0
pcA$ git branch -a
* dev
  dev_1
  dev_2
  remotes/svr/dev
pcA$ git push  # only dev --> remotes/svr/dev is desired.

However,

pcB$ git branch -a
* dev
  remotes/svr/dev
pcB$ git pull
pcB$ git branch -a
* dev
  dev_1
  remotes/svr/dev

Please kindly indicate:

  1. how to remove dev_1 in svr and and pcB ?
  2. how to avoid dev_1 and dev_2 get pushed ?
  • 4
    Possible duplicate of [Delete a Git branch both locally and remotely](http://stackoverflow.com/questions/2003505/delete-a-git-branch-both-locally-and-remotely) – DaveyDaveDave Dec 10 '15 at 15:31

1 Answers1

2

You can delete a remote branch using (in svr)

git push origin --delete <branchName>

To delete a branch in your local (pcB in your case):

git branch -D <branchName>

Also to push only a single branch to a branch on the remote repository, you can use

git push origin <branchName>

Also if you face any problem doing this, you can try forcing it using the flag --force, for example:

git push origin --delete --force <branchName>
computnik
  • 287
  • 1
  • 3
  • 15