I know there are already questions about this but I don't think there quite available in 2.8 blender. I want to rotate the bone so the bones will be lined up in a straight axis. How do I do it?
- Go into edit mode.
- Select the tip of the second bone and snap the cursor to it. ⇧ ShiftS
- Select the root of the first bone and extrude a new helper bone from it. E
- Select the tip of the helper bone and snap it to the cursor. ⇧ ShiftS
- Select the helper bone.
- Choose the normal orientation for transformations.
- Create a custom transform orientation from the normal orientation.
- Delete the helper bone. (We have the custom orientation from the root of the first bone to the tip of the second bone, and that is all that we need.) X
- Choose the 3D Cursor as Pivot Point. . / numpadperiod
- Select the root of the second bone and scale it to 0 on the custom XZ axis, by pressing S[⇧ ShiftY]0. (Shift has to be held while Y is pressed, this constrain scaling along the XZ axis of the custom transform orientation.)
- Copy paste the roll property from one bone to the other.
This answer expands on how the custom transform orientation works.
I'm supposing you have two copy rotation constraints, so that rotating the first bone will cause the rotation of the two others also; but the finger is deforming weirdly. This is not a problem of location and alignement of bones, but to their roll instead (rotation of their longitudinal Y axis in edit mode).
So, this is a good procedure to set up your rig: select an edge loop in which you want the rotation to happen and press Shift S "Cursor to selected", then select in edit mode the apprpriate bones joint and press Shift S "Selection to cursor"; after having completed the procedure for all bones joints you will have the bone chain that can be straight or curved, according to the mesh, but nevermind.
Activate the axes viewport display in the armature properties and adjust the roll of every bone, so that the desired "main" rotation will happen with positive X axis variations (you could use Z also, but positive X is an accepted convention).
In this way you will see that the behaviour of the rig will be as expected, even if the bones are not aligned in a straight line.
Then, if you really want to align your bones, Leander's answer is perfect.