github - work flow for using git 2.5 for multiple work directories using 'git worktree' -
being new git, i'm trying overview of how use multiple work directories different branches off 1 github project. in particular want/need work on 2 branches - 1 'master' other 1 maintenance release, maintenance/project1. plan run work under linux/mint 17.2. well, make use of latest git worktree features introduced in 2.5.
assuming have github account, have forked own fork off main project , have cloned fork local machine in ~/user/myproject.
as things stand now, don't expect contribute code via git push, results of work & testing passed on others possible fixes via e-mail - doing via git might nice down road, won't necessary start.
what see steps need corresponding set of git commands are:
- creating 2 work tree
- switching between these trees
- keeping both trees up-to-date upstream master
- any other cautions/ special considerations working way.
creating 2 work trees
git clone https://github.com/someone/someproject.git
(this give directory
someproject
onmaster
branch)cd someproject; git worktree add ../someproject-devel devel
(this give directory
someproject-devel
ondevel
branch, assuming such branch exists)
switching between these trees
just use cd
command.
keeping both trees up-to-date upstream master
just cd
in appropriate directory , run git pull
. doing in main working tree first may best, not required (the man page not address specifically, , haven't looked worktree implementation in detail. if issue existed 1 of optimal use of space, not functionality).
any other cautions/ special considerations working way.
from man page:
multiple checkout in general still experimental, , support submodules incomplete. not recommended make multiple checkouts of superproject.
Comments
Post a Comment