I am using gitlab and really confused in few things. :
- When we create new branch by git checkout -b test. Does it create copy of master or it creates copy of branch i am currently in?
For example: I am currently at branch dev, then i write command git checkout -b test. So it will be copy of dev, not masters?
- Pull : when we write git pull , it pulls changes of current branch from remote branch of same name. Its used when more people are working on same project.
Example : I am at branch dev, i write git pull, it updates my local as of dev in remote. Now i created a new branch test, checkout test branch and do git pull. It gives me :There is no tracking information for the current branch. Please specify which branch you want to rebase against.
its because there is no test branch in remote ? What command to be used if i want to pull from dev branch while my current branch is test? is it git pull --rebase dev test?
- When we write git push, it pushes current branch to remote one. example : i am on branch test, i add, commit and write git push. It simply pushes my branch test to remote with same name as test. Can we push to specific branch like push test to dev?
What is difference in following considering i am at branch test: git push git push origin test they both push to remote?
My requirement is : there is branch dev which is not master branch, i am supposed to work on this branch as starting and end point. Like, new branch should be copy of this and i am supposed to push to same branch.