1

I have two branches:
1. Master
2. Staging

All my commit available in staging branch but in master branch it have only necessary commit which I push using cherry-pick from staging branch.

Now the issue is, I have re-set up this repository in my local machine but when I clone this repo using git clone https:repository-url.git then it will create only one master branch and only appear master branch commit so how can I also clone my staging branch and their commit?

I already try to git checkout -b staging but it will make a copy from master branch.

Mureinik
  • 252,575
  • 45
  • 248
  • 283
Camit1dk
  • 350
  • 2
  • 14
  • Possible duplicate of [How to clone all remote branches in Git?](https://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git) – phd Jan 08 '19 at 11:29
  • https://stackoverflow.com/search?q=%5Bgit%5D+clone+all+branches – phd Jan 08 '19 at 11:29

1 Answers1

2

git branch -r will show you all the local copies of the remote branches, such as origin/master and origin/staging. Just run git checkout staging (without the -b!) to create a local staging branch that tracks the remote one.

Mureinik
  • 252,575
  • 45
  • 248
  • 283