An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
Git cheat sheet
Setting up Git git config --global user.name "Your Name"
: Set your Git usernamegit config --global user.email "[email protected]"
: Set your Git email addressgit config --list
: List all Git configuration settings
Creating a new repositorygit init
: Create a new local repositorygit clone [url]
: Clone an existing repository from a remote source
Adding and committing changesgit add [file]
: Add changes to the staging areagit add .
: Add all changes to the staging areagit commit -m "Commit message"
: Commit changes to the local repository with a message
Working with branchesgit branch
: List all branchesgit branch [branch-name]
: Create a new branchgit checkout [branch-name]
: Switch to a specific branchgit merge [branch-name]
: Merge changes from a specific branch into the current branchgit push origin [branch-name]
: Push changes to a remote repository
Working with remote repositoriesgit remote add origin [url]
: Add a remote repositorygit pull
: Fetch and merge changes from a remote repositorygit push
: Push changes to a remote repositorygit remote -v
: List all remote repositories
Other helpful commandsgit status
: Show the status of your repositorygit log
: Show the commit history of your repositorygit diff [file]
: Show the changes made to a specific file.
These are some of the most commonly used Git commands. I hope this cheat sheet helps you in your Git journey!
Original Link: https://dev.to/zamuhajji/git-cheat-sheet-4lce
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To