-1

I am completely new to using github for code maintenance. I have made a repository in github and it's having a by default master branch. From the master branch I made a development branch and from the development branch I created four branches(say feature1,feature2,feature3,feature4).

My requirement is that it needs to work only in feature1 branch i.e I need to pull the code only from feature1 and push to feature1 only. And finally when feature1 is complete I need to merge feature1 to the development branch.

Please suggest the steps to achieve the above requirement using command line interface. I did a web search for this requirement but didn't get any much help.

Thanks

SoConfused
  • 1,581
  • 3
  • 11
  • 18
amit64
  • 9
  • 1
  • 1
    I suggest you read the first three chapters of [Pro Git](https://git-scm.com/book/en/v2). Chapters 2 and 3 will explain the commands that you need to accomplish your homework assignment. – Code-Apprentice Aug 21 '18 at 16:35
  • Have a look at https://stackoverflow.com/a/43364619/5784831. You See interested in the -u flag in push. – Christoph Aug 21 '18 at 16:39

1 Answers1

0

So first of all you have to git init your folder where you're working in. That can be done using the following command in powershell:

$ git init

After that you have to define your remote:

$ git remote add origin <Your HTTPS GitHub URL>

Now you added your remote. Normally you are now working in the master branch. That's what we want to change now to your feature1 branch:

$ git checkout feature1

So now you can pull and push from and to feature1:

$ git merge feature1
$ git push origin feature1

If you have finished to pull to your feature1 branch and want to commit your changes to the development branch, you have to do the following:

$ git push origin feature1:development
Gilles Heinesch
  • 2,633
  • 1
  • 18
  • 39