Git中的Config命令

时间:2019-03-05 14:02:48

标签: git github

git中config命令的用途是什么?我看不出要点,因为我可以像输入任何用户名和电子邮件一样输入它,并且即使没有确认也接受它。

由于我只是一个初学者,这可能是一个愚蠢的问题。

该命令供参考:

<?xml version="1.0"?> <!-- License: Apache 2.0. See LICENSE file in root directory. Copyright(c) 2017 Intel Corporation. All Rights Reserved This is the URDF model for the Intel RealSense 430 camera, in it's aluminum peripherial evaluation case. --> <robot name="sensor_d4352" xmlns:xacro="http://ros.org/wiki/xacro"> <xacro:macro name="sensor_d415" params="sensor_name parent *origin"> <xacro:property name="M_PI" value="3.1415926535897931" /> <!-- The following values are approximate, and the camera node publishing TF values with actual calibrated camera extrinsic values --> <xacro:property name="d435_cam_depth_to_left_ir_offset" value="0.0"/> <xacro:property name="d435_cam_depth_to_right_ir_offset" value="-0.050"/> <xacro:property name="d435_cam_depth_to_color_offset" value="0.015"/> <!-- The following values model the aluminum peripherial case for the D435 camera, with the camera joint represented by the actual peripherial camera tripod mount --> <xacro:property name="d435_cam_width" value="0.090"/> <xacro:property name="d435_cam_height" value="0.025"/> <xacro:property name="d435_cam_depth" value="0.02505"/> <xacro:property name="d435_cam_mount_from_center_offset" value="0.0149"/> <!-- The following offset is relative the the physical D435 camera peripherial camera tripod mount --> <xacro:property name="d435_cam_depth_px" value="${d435_cam_mount_from_center_offset}"/> <xacro:property name="d435_cam_depth_py" value="0.0175"/> <xacro:property name="d435_cam_depth_pz" value="${d435_cam_height/2}"/> <material name="aluminum${sensor_name}"> <color rgba="0.5 0.5 0.5 1"/> </material> <!-- camera body, with origin at bottom screw mount --> <joint name="camera_joint${sensor_name}" type="fixed"> <xacro:insert_block name="origin" /> <parent link="${parent}"/> <child link="camera_bottom_screw_frame${sensor_name}" /> </joint> <link name="camera_bottom_screw_frame${sensor_name}"/> <joint name="camera_link_joint${sensor_name}" type="fixed"> <origin xyz="0 ${d435_cam_depth_py} ${d435_cam_depth_pz}" rpy="0 0 0"/> <parent link="camera_bottom_screw_frame${sensor_name}"/> <child link="camera_link${sensor_name}" /> </joint> <link name="camera_link${sensor_name}"> <visual> <origin xyz="${d435_cam_mount_from_center_offset} ${-d435_cam_depth_py} 0" rpy="${M_PI/2} 0 ${M_PI/2}"/> <geometry> <!-- <box size="${d435_cam_width} ${d435_cam_height} ${d435_cam_depth}"/> --> <mesh filename="package://realsense2_camera/meshes/d435.dae" /> <!--<mesh filename="package://realsense2_camera/meshes/d435/d435.dae" />--> </geometry> <material name="aluminum"/> </visual> <collision> <origin xyz="0 ${-d435_cam_depth_py} 0" rpy="0 0 0"/> <geometry> <box size="${d435_cam_depth} ${d435_cam_width} ${d435_cam_height}"/> </geometry> </collision> <inertial> <!-- The following are not reliable values, and should not be used for modeling --> <mass value="0.564" /> <origin xyz="0 0 0" /> <inertia ixx="0.003881243" ixy="0.0" ixz="0.0" iyy="0.000498940" iyz="0.0" izz="0.003879257" /> </inertial> </link> <!-- camera depth joints and links --> <joint name="camera_depth_joint${sensor_name}" type="fixed"> <origin xyz="0 0 0" rpy="0 0 0"/> <parent link="camera_link${sensor_name}"/> <child link="camera_depth_frame${sensor_name}" /> </joint> <link name="camera_depth_frame${sensor_name}"/> <joint name="camera_depth_optical_joint${sensor_name}" type="fixed"> <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" /> <parent link="camera_depth_frame${sensor_name}" /> <child link="camera_depth_optical_frame${sensor_name}" /> </joint> <link name="camera_depth_optical_frame${sensor_name}"/> <!-- camera left IR joints and links --> <joint name="camera_left_ir_joint${sensor_name}" type="fixed"> <origin xyz="0 ${d435_cam_depth_to_left_ir_offset} 0" rpy="0 0 0" /> <parent link="camera_depth_frame${sensor_name}" /> <child link="camera_left_ir_frame${sensor_name}" /> </joint> <link name="camera_left_ir_frame${sensor_name}"/> <joint name="camera_left_ir_optical_joint${sensor_name}" type="fixed"> <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" /> <parent link="camera_left_ir_frame${sensor_name}" /> <child link="camera_left_ir_optical_frame${sensor_name}" /> </joint> <link name="camera_left_ir_optical_frame${sensor_name}"/> <!-- camera right IR joints and links --> <joint name="camera_right_ir_joint${sensor_name}" type="fixed"> <origin xyz="0 ${d435_cam_depth_to_right_ir_offset} 0" rpy="0 0 0" /> <parent link="camera_depth_frame${sensor_name}" /> <child link="camera_right_ir_frame${sensor_name}" /> </joint> <link name="camera_right_ir_frame${sensor_name}"/> <joint name="camera_right_ir_optical_joint${sensor_name}" type="fixed"> <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" /> <parent link="camera_right_ir_frame${sensor_name}" /> <child link="camera_right_ir_optical_frame${sensor_name}" /> </joint> <link name="camera_right_ir_optical_frame${sensor_name}"/> <!-- camera color joints and links --> <joint name="camera_color_joint${sensor_name}" type="fixed"> <origin xyz="0 ${d435_cam_depth_to_color_offset} 0" rpy="0 0 0" /> <parent link="camera_depth_frame" /> <child link="camera_color_frame${sensor_name}" /> </joint> <link name="camera_color_frame${sensor_name}"/> <joint name="camera_color_optical_joint${sensor_name}" type="fixed"> <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" /> <parent link="camera_color_frame${sensor_name}" /> <child link="camera_color_optical_frame${sensor_name}" /> </joint> <link name="camera_color_optical_frame"/> </xacro:macro> </robot>

1 个答案:

答案 0 :(得分:1)

config命令的重点是设置配置值。您提供的特定示例-设置电子邮件地址-只是config命令的许多用途之一。

除此之外,您的问题让我感到困惑。您看不到能够指定电子邮件地址的价值,因为它不验证电子邮件地址吗?

每个git commit都标记有作者姓名和电子邮件,以及committer名称和电子邮件。您需要一种方法来告诉git进行提交时要使用哪些值。如果您认为这可以以某种方式帮助您,则可以输入不正确的值。并且知道,任何不(或不应该)信任您的项目都会知道,它不能依赖此信息来获取任何敏感信息。

提交中的作者/提交者值不保证是准确的-您可以在这些字段中输入任何内容。有一些功能可以通过可验证的方式将身份与提交相关联,但是基本名称/电子邮件配置设置不在其中。这些也不会用于访问控制-如果您需要基于用户的访问控制,则远程主机的托管软件可能会提供它。

尽管如此,大多数团队还是使用这些配置值来快速识别谁产生了提交,而这通常不需要密码验证。