Leadership style can encourage the behavior of employees in the organization. Several previous studies have shown the effect of leadership style on knowledge sharing. Nevertheless, more empirical proof is needed to show the various leadership style’ moderation effect. We conduct a literature review to analyze the determinants of knowledge sharing and empirical studies of the moderation effects of leadership styles on the determinants of knowledge sharing in government. The questionnaire survey collected 619 civil servants from a ministry in Indonesia. The test model uses the PLS-SEM method. The results showed that the factors that significantly influenced knowledge-sharing behavior were self-efficacy, horizontal trust, IT adoption, and organizational commitment. The results reveal that transformational leadership significantly moderates recognition reward and knowledge-sharing behavior. Furthermore, transactional leadership significantly moderates IT adoption and knowledge-sharing behavior. However, charismatic and servant leadership do not positively moderate these determinants of knowledge-sharing behavior. This research contributes to the literature on leadership styles and knowledge sharing. This research integrates several past research to confirm the factors influencing knowledge-sharing behavior among civil servants in developing countries. This research is expected to help governments and practitioners consider appropriate policies to encourage knowledge sharing within government organizations. This research filled a gap in the previous study by investigating the moderation effects of various leadership styles on the determinants of knowledge-sharing behavior among civil servants.