1

How I can create following branches on stash and push code into them using git.

  1. Development1
  2. Development2
  3. Production

Please let me know your thoughts for the same.

Rog
  • 4,075
  • 2
  • 24
  • 35

1 Answers1

0

To create your branches:

git checkout -b Development1
git checkout -b Development2
git checkout -b Production

To push your branches:

git push origin Development1
git push origin Development2
git push origin Production

Edit:

origin is your default repository.

Use git remote -v to see your repositories and git remote add [name] [url] to add a new repository.

Sample: (push your branch to remote repository)

git remote add somerepo https://somerepo.com/somerepo
git push somerepo Production
Haroldo Gondim
  • 7,725
  • 9
  • 43
  • 62
  • we don,t need to specify repository name along with branch while push the data? – Mahabir Singh Aug 18 '15 at 04:56
  • How haroldo, please can you explain me little bit more about stash. – Mahabir Singh Aug 19 '15 at 07:31
  • I have one query, if we had there branches than code will be different for all three branches?, I am asking these becoz I am fresher in stash, no understanding about this. – Mahabir Singh Aug 19 '15 at 07:34
  • I am getting this error when I tried to push code in development1 branch-----------------$ git push origin Development1 error: src refspec Development1 does not match any. error: failed to push some refs to 'http://admin@localhost:7990/scm/trd/repos2.git' – Mahabir Singh Aug 19 '15 at 13:41
  • development1 should be Development1? – Haroldo Gondim Aug 20 '15 at 01:52