Memo Commandes GIT
Push Commit
- Add and updates files
# Add a specific file
git add filename
# Add all changed files in current directory
git add .
- Create new commit
# Add commit message directly in commit command
git commit -m "New commit"
# Open editor to write commit message
git commit
- Push commit ans files to server
push origin branch_name
# Push to "main" branch
push origin main
Manage Branch
- Check exiting branch
git branch
- Switch to an existing branch
git checkout <branch_name>
- Or create a new branch with -b optin
git checkout -b <new_branch>