Giter Club home page Giter Club logo

git-config-script's Introduction

git-config-script

License ShellCheck

This script helps setup git for a new install. When installing git, you get several warnings about settings you need to configure, including setting a username, an email address and a default branch name. To avoid these warnings, it is needed to set global settings that would be used by default for each repo. In addition, it is recommended to set a GPG or SSH key that will be used for signing commits. I wrote a shell script to help with this process.

This script does the following:

  • configures global git.user (according to user input).
  • configures global git.email (according to user input).
  • configures "main" as the default branch name.
  • Generates a new SSH key and configures it to be used as the global Signing Key for git.
  • Shows instructions for adding the SSH Key to GitHub and other git providers (GitLab, Codeberg, Gitea, Forgejo and Gogs).

After running this script, your ~/.gitconfig file should look similar to .gitconfig.sample.

FAQ - Frequently Asked Questions

How do I run this script?

Ths script can be run with the following command:
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/develeap/git-config-script/main/shell-script/git-config.sh)"
Make sure to run it on your own user since it needs access to your HOME folder. Do not run this script as root/sudo/doas.

Which platforms are supported?

All Unix platforms that support recent-enough versions of git and OpenSSH should work, including modern Linux distros, macOS and WSL.

I don't want to run random shell scripts from GitHub.

This is understandable. I encourage every user to understand what any shell script does before blindly running it. This script is open-source; you can read its source code to see what it does, and judge for yourself if you want to run it. For this script, root access is not required nor wanted.

Is this script really necessary? I can do all this on my own.

It is true that you can achieve the same results just by running a few commands. All this script really does is generate an SSH key and edits your ~/.gitconfig. However, after doing this process many times across different git installs, I decided to automate it with this script.

Resources

To read more about what this script does and related topics, have a look at these resources:

git-config-script's People

Contributors

roib20 avatar

Stargazers

 avatar Gilad Neiger avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.