Quick TYPO3 Git Cheat Sheet for TYPO3 Development

Are you looking for quick TYPO3 Git Cheat Sheet for TYPO3 Development? Check out the basic to advanced level helpful TYPO3 git commands, Keep best practice with your favourite git tools like Github, Gitlab, Bitbucket etc.

// Global Configuration
git config --global user.name "YOUR_USERNAME"
git config --global user.email "your_email_address@example.com"

// Initiate and clone git from repote
git init
git clone [URL]

// Know current branch name
git branch
git branch -a

// Manage branch
git branch [branch name]

// Checkout specific branc
git checkout [branch name]

// Get latest code
git pull
git pull origin [branch name]

// Check status
git status
git diff
git diff [source branch] [target branch]

// Add files
git add [file-name.txt]                         // Add a file to the staging area
git add -A                                      // Add all new and changed files to the staging area
git add .                                       // Add all new and changed files to the staging area

// Commit the code
git commit -m "[TASK] commit message"           // Commit changes
git push                                        // Push changes to remote repository
git push origin [branch name]                   // Push a branch to your remote repository

// Remove files/folders
git rm file1.txt                                // Remove single file
git rm -r [folder name]                         // Remove multiple files
git commit -m "remove file1.txt"                // Commit changes
git push origin [branch name]                   // Push changes

// Branching & Merging
git branch [branch name]                        // Create a new branch
git branch -d [branch name]                     // Delete a branch
git push origin --delete [branch name]          // Delete a remote branch
git checkout -b [branch name]                   // Create a new branch and switch to it
git checkout -b [branch name] origin/[branch]   // Clone a remote branch and switch to it
git merge [branch name]                         // Merge a branch into the active branch
git merge [source branch] [target branch]       // Merge a branch into a target branch

Post a Comment

×
Captcha Code Can't read the image? Click here to refresh

Got answer to the question you were looking for?