ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] GIT vs SVN

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Fri, 25 Apr 2014 13:48:00 -0400
On 04/25/14 12:23, Peter Wu wrote:
On Friday 25 April 2014 11:27:35 Jeff Morriss wrote:
Basically:

1) Create a branch off master (git checkout -b myprivatebranch master)
2) Make your changes
3) Check in your changes (git commit -a)
3.a) Make sure you never "git push" from this branch :-).  If someone
knows a way to make it impossible, please let me know.

If you do not set a remote for this branch, then this branch won't be pushed.
The default behavior of "git push" without options can be configured with the
"push.default" setting (see man git-config(1)).

There is nothing that prevents you from running `git push origin foo` though.

I don't like to type so many characters so I never type "git push origin <anything>" anyway. Then again, I never type "git push" now, I just do "git review -f".

Then if you want to pull in the later changes just do:

4) git checkout master
5) git pull
6) git rebase master myprivatebranch

If you don't need to update master, you can follow this:

Well, that's an interesting question. I guess the branch is pretty useless for me since I normally stay in my private branch. Its only purpose is to serve as a starting point for things which will eventually be pushed ("git checkout -b bugXXXX master").

4) git fetch

(assuming that your current branch is myprivatebranch)
5a) git rebase origin/master
(otherwise, to combine git checkout && git rebase origin/master:)
5b) git rebase origin/master myprivatebranch

Cool, thanks!

git's pretty cool in that steps 4-6 can be automated: I have a script
named ~/bin/git-uup (haven't thought of a better name) which does 4-6 so
I only have to type "git uup && make -j 9".

git fetch && git rebase origin/master && time make -j9

Of course after the first time that becomes "escape-/rebase" followed by "enter." Otherwise it's way too much typing. :-)