-
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:
#To show all local and remote branches:
$ git branch -a
#To show only all remote branches:
$ git branch -r
$ git checkout --track origin/develop
$ git checkout develop
$ git pull origin develop
*** If you want to 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:
- create a new branch
$ git branch featue1
- switch to the new branch
$ git checkout feature1
>> Now you edit files and make change, then add and commit:
$ git add .
- record changes in the new branch
$ git commit -m ‘add test’
- compare with the develop branch
$ git diff develop
- switch back to the develop branch
$git checkout develop
- merge feature1
$git merge --no-ff feature1