[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gits] Git Workflow



So Dan came by asking how best to get some of the work in his personal
emulab-devel repo into the mainline emulab-devel repo.  He's been
working via the 'master' branch in his personal repo, so I recommended
the following steps:

git checkout master
git fetch central  # central is the 'remote' name in his repo for the
mainline emulab-devel repo.
git rebase central/master
<If necessary, fix any merge conflicts and resume rebase.>
git diff central/master
<Look carefully to make sure only the changes he intends are going in.>
git push -f origin master
git push central master

However, there is a fly in the ointment - he doesn't want to push all
of the stuff in his personal repo to emulab central just yet.  So, I
suggested:

git checkout master
git checkout -b <some_new_branch_name>
git checkout master
git rm <files_to_leave_out_of_emulab_central_commit>
git fetch central
git rebase central/master
<If necessary, fix any merge conflicts and resume rebase.>
git diff central/master
<Look carefully to make sure only the changes he intends are going in.>
git push -f origin master
git push central master

I also suggested he look at the view of his repo with 'gitk' to spot
any squirrelly-looking stuff before pushing to central/master.

Any other words of wisdom or alternate paths to enlightenment, o
masters of git-fu?  I'm sure there are better ways to move the commits
he doesn't want to apply elsewhere - I just don't know them offhand.

-Kirk