# Initialize a repository git init # Check repository status git status # Add a file git add filename # Add all changes git add . # Create a commit git commit -m "Initial commit" # View commit history git log # Create a branch git branch feature # Switch branches git checkout feature # Create and switch to a branch git checkout -b feature # Add a remote repository git remote add origin https://github.com/user/repository.git # Push the current branch git push -u origin main # Pull changes git pull