Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Git Tutorial
  • Git Exercises
  • Git Basic Commands
  • Git Cheat Sheet
  • Git Interview Questions
  • Git Bash
  • GitHub
  • Git Branch
  • Git Merge
  • Git WorkFlow
  • Git Hooks
  • Git LFS
  • Git Rebase
  • Git Cherry Pick
Open In App
Next Article:
How to Change Git Username in Terminal?
Next article icon

How to Set Git Username and Password in GitBash?

Last Updated : 08 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Setting up your Git username and password is an essential step when working with Git repositories. It helps you confirm your identity when sending (pushing) changes or getting (pulling) updates from a remote repository.

In this guide, we will show you how to easily set your Git username and password using Git Bash, a tool that helps you manage your Git projects. By following these simple steps, you’ll be ready to start working with Git without any hassle.

What is Git Bash?

Git Bash is a command-line interface application that provides a Unix-like Terminal Environment on Windows operating systems. It allows users to interact with Git, a version control system, and run Unix commands directly from the command line. Git Bash also includes a set of Bash utilities and Git commands for managing repositories, making it easier for users familiar with Unix-like environments to work with Git on Windows.

How to Set Git Username and Password in GitBash

Follow the below easy steps to Set Git Username and Password in Gitbash:

Step 1: Open Git Bash

After you’ve installed Git, go to the folder where you want to open Git Bash. Right-Click in the Folder and select “Git Bash Here” This will open the Git Bash terminal in that folder.

setting-git-username-and-password-in-gitbash

setting-git-username-and-password-in-gitbash

Git Bash opened on Desktop.

Step 2: Set your Username

To set your Git Username, run the following command in Git Bash:

$ git config --global user.name "GeeksforGeeks"

setting-git-username-and-password-in-gitbash

Step 3: Set your Email

After that, you will have to configure your email. For that, type

$git config --global user.email "[email protected]"

setting-git-username-and-password-in-gitbash

Step 4: Set your Password

Git doesn’t directly store passwords in the configuration file, but you can set up a credential helper to store your password securely for future use. Run this command:

$git config --global user.password "1234321"

setting-git-username-and-password-in-gitbash

Step 5: Store Credentials Permanently

To avoid entering your username and password every time, use the following command to store your credentials

$ git config --global credential.helper store

setting-git-username-and-password-in-gitbash

This is how you set git username and password in git bash.

To check the inputs, type the below command as depicted:

$ git config --list --show-origin

setting-git-username-and-password-in-gitbash



Next Article
How to Change Git Username in Terminal?

D

deathmukh
Improve
Article Tags :
  • DevOps
  • Git
  • How To

Similar Reads

  • How to Save Username And Password in Git?
    Managing credentials efficiently is important for seamless interaction with remote Git repositories. By default, Git prompts for a username and password each time you interact with a remote repository. To simplify this process, you can configure Git to save your credentials, allowing for a smoother
    3 min read
  • How to Set Username and Password in MongoDB Compass
    In MongoDB, authentication is not enabled by default, which means anyone can access the database. To enhance security, especially in production environments, it is essential to create users with specific roles and permissions. In this article, We will go through setting up a username and password in
    3 min read
  • How to Change Git Username in Terminal?
    Suppose you're using Git for version control. In that case, you might want to change your Git username for various reasons—whether it's for correcting a typo, updating it to a new username, or switching to a different account. You can change your Git username in two ways: Globally: This sets the use
    4 min read
  • What is Git-Ignore and How to Use it?
    There are various types of files we might want the git to ignore before committing, for example, the files that are to do with our user settings or any utility setting, private files like passwords and API keys. These files are not of any use to anyone else and we do not want to clutter our git. We
    5 min read
  • How To Use Git And GitHub?
    Git and GitHub are important tools for modern software development, enabling version control, collaboration, and efficient code management. This guide provides an overview of how to use Git and GitHub, from setting up your environment to contributing to projects. Table of Content What is Git?What is
    4 min read
  • Git - How to Solve "remote: Invalid username or password. fatal: Authentication failed"?
    Encountering the "remote: Invalid username or password. fatal: Authentication failed" error can be frustrating, especially when you're trying to push or pull changes to a Git repository. This issue is commonly related to authentication problems with your Git remote repository. In this article, we'll
    3 min read
  • How to Install and Use GIT in Android Studio?
    Git is created by Linus Torvald. Git is the most popular Version Control System in the world, used by millions of developers. It helps us to keep track of all the files in a project. Git tracks every change that are made. If we make a mistake, it can reset a file to match a previous version or we ca
    4 min read
  • How to Set Upstream Branch on Git?
    It is important to Setup an Upstream Branch in Git to make the workflow smooth and manage branches efficiently. When you want to clone a new repository or work with various feature branches, you need to know how to work with upstream branches and how you can set them up. In this article, we will exp
    4 min read
  • How to Setup Git Using Git Config?
    Git is a powerful version control system that helps developers manage their code efficiently. To use Git effectively, you need to configure it properly using the git config command. This setup ensures that Git recognizes your identity, preferred settings, and workflow preferences. How the git config
    3 min read
  • How to Add Upstream in Git?
    When you fork a repository, you create a copy of it under your own account. However, as the original repository updates with new features, bug fixes, and improvements, you'll want to keep your forked repository up-to-date with these changes. This is where adding an upstream remote in Git comes into
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences