-
Notifications
You must be signed in to change notification settings - Fork 11
Home
## How to track and update the 'develop' in GitHub from your local dir:
$ git branch -a #To show all local and remote branches: $ git branch -r #To show only all remote branches:
$ git checkout --track origin/develop # To track changes 'develop' branch in your local dir:
$ git checkout develop # To switch to the 'develp' branch in your local dir:
$ git pull origin develop # To update your local develop branch from the Github develop branch
- If you want merge for example 'nesting' or 'Fram' in 'develop' branch and push it to the git hub:
1- first switch to 'develop' $ git checkout develop
You can verify this by running '$git branch -a' and you will see a * pointing to 'develop' on the list 2- Now run merge command
$ git merge --no-ff nesting
This will update 'develop' with all new changes in 'nesting' in you local dir: If you there are some conflicts in some files, then you have to resolve them by opening these files one by one.
3- Now add and commit
$ git add . $ git commit -m ‘nesting is now merged to develop’ # record changes in the new branch
To pull updates the corresponding 'develop' branch in Github:
$ git push origin develop
****## General command Creating a new branch/edit and commit in your local dir and merge with develop branch:
$ git branch featue1 # create a new branch $ git checkout feature1 # switch to the new branch Now you edit files and make change $ git add . $ git commit -m ‘add test’ # record changes in the new branch
- Compare with master git diff master # compare with the master branch git checkout master # switch back to the master branch git merge feature1 # merge branches into master