Git
User Profile
git config --global user.email "[email protected]"
git config --global user.name "Serge Kurian"
Repository Management
Init with Main Branch
Create New Repository
echo "# delete" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:jdedev/delete.git
git push -u origin main
Branches
To be added
Common Git Commands
Commit
Restore Unstaged Changes
Submodules
Add Submodule
git submodule add [email protected]:jdedev/doc_git.git
Init/Pull Submodules (after clone)
Update Submodules (get latest changes)
Clone and Check-out Submodules
Missing submodules are cloned.
All submodules are checked out correctly.
The latest changes are pulled from each submodule’s remote repository.