ninetydegrees (90d)☕ (
ninetydegrees) wrote in
dw_dev_training2012-08-28 11:00 am
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Git: more newbie questions
1) If you're working on bug A on branch A then want to work on completely unrelated bug B on branch B, do you need to stash you changes on A checkout develop then create branch B?
Answer: yes, but see comments about using git commit and git commit --amend in your workflow.
2) When can you use git diff? Before add only? Because otherwise it gives me nothing and I have to use git status -v.
Answer: possibly with git diff --cached or git diff HEAD^ HEAD (untested)
3) Oh I feel so stupid for asking this but how do you get out of git diff or git log on PuTTY? Ctrl+C and Ctrl+X don't work.
Answer: the magic key is 'q' and this is related to PAGER and not PuTTY
4) If you're working on bug A on branch A and have reached a point where you want to do some more work but be easily able to revert to where you were before, what is the best route? Several commits? Creating a subbranch A1 (is that possible?)? Is that where merge is useful? I'm having the hardest time understanding how merge can be used concretely.
Answer: several commits is indeed the best route; the concept of 'subbranches' isn't valid.
5) In git config, is there a way to reset the value of core.editor to whatever is the default on your computer (without naming the editor)?
Answer: yes, with git config --global --unset core.editor
Answer: yes, but see comments about using git commit and git commit --amend in your workflow.
2) When can you use git diff? Before add only? Because otherwise it gives me nothing and I have to use git status -v.
Answer: possibly with git diff --cached or git diff HEAD^ HEAD (untested)
3) Oh I feel so stupid for asking this but how do you get out of git diff or git log on PuTTY? Ctrl+C and Ctrl+X don't work.
Answer: the magic key is 'q' and this is related to PAGER and not PuTTY
4) If you're working on bug A on branch A and have reached a point where you want to do some more work but be easily able to revert to where you were before, what is the best route? Several commits? Creating a subbranch A1 (is that possible?)? Is that where merge is useful? I'm having the hardest time understanding how merge can be used concretely.
Answer: several commits is indeed the best route; the concept of 'subbranches' isn't valid.
5) In git config, is there a way to reset the value of core.editor to whatever is the default on your computer (without naming the editor)?
Answer: yes, with git config --global --unset core.editor
no subject
Half the fun for me so far has been making mistakes and trying to figure out how to fix them; sometimes it's ridiculously easier than it used to be and sometimes you have to Google things a bit (also ridiculously easy).