𝙸𝚗𝚝𝚛𝚘𝚍𝚞𝚌𝚒𝚗𝚐 𝚘𝚞𝚛 𝚊𝚕𝚕-𝚗𝚎𝚠 𝙲𝙿 𝙱𝙾𝙾𝚃𝙲𝙰𝙼𝙿, 𝚊 𝚜𝚎𝚛𝚒𝚎𝚜 𝚘𝚏 𝚜𝚎𝚜𝚜𝚒𝚘𝚗𝚜 𝚕𝚒𝚔𝚎 𝚗𝚎𝚟𝚎𝚛 𝚋𝚎𝚏𝚘𝚛𝚎. 𝙸𝚏 𝚢𝚘𝚞 𝚊𝚛𝚎 𝚠𝚒𝚕𝚕𝚒𝚗𝚐 𝚝𝚘 𝚑𝚊𝚟𝚎 𝚊 𝚜𝚝𝚛𝚘𝚗𝚐 𝚌𝚘𝚖𝚖𝚊𝚗𝚍 𝚘𝚟𝚎𝚛 𝚢𝚘𝚞𝚛 𝙳𝚂-𝙰𝚕𝚐𝚘 𝚜𝚔𝚒𝚕𝚕𝚜 𝚊𝚗𝚍 𝚖𝚊𝚔𝚎 𝙲𝙿 𝚢𝚘𝚞𝚛 𝚋𝚎𝚜𝚝 𝚏𝚛𝚒𝚎𝚗𝚍, 𝚝𝚑𝚎 𝚝𝚒𝚖𝚎 𝚒𝚜 𝙽𝙾𝚆!!!
𝙰𝚏𝚝𝚎𝚛 𝚌𝚕𝚘𝚗𝚒𝚗𝚐 𝚝𝚑𝚎 𝚛𝚎𝚙𝚘𝚜𝚒𝚝𝚘𝚛𝚢, 𝚌𝚛𝚎𝚊𝚝𝚎 𝚊 𝚏𝚘𝚕𝚍𝚎𝚛 𝚠𝚒𝚝𝚑 𝚢𝚘𝚞𝚛 𝚗𝚊𝚖𝚎 𝚊𝚗𝚍 𝚛𝚘𝚕𝚕 𝚗𝚘. 𝚊𝚜 𝚝𝚑𝚎 𝚏𝚘𝚕𝚍𝚎𝚛 𝚗𝚊𝚖𝚎 𝚊𝚗𝚍 𝚊𝚍𝚍 𝚊𝚕𝚕 𝚝𝚑𝚎 𝚌𝚘𝚍𝚎𝚜 𝚊𝚗𝚍 𝚊𝚜𝚜𝚒𝚐𝚗𝚖𝚎𝚗𝚝𝚜 𝚒𝚗𝚜𝚒𝚍𝚎 𝚝𝚑𝚊𝚝 𝚏𝚘𝚕𝚍𝚎𝚛.
Command | Description |
---|---|
git init |
Initialize a local Git repository |
git clone ssh://[email protected]/[username]/[repository-name].git |
Create a local copy of a remote repository |
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 commit -m "[commit message]" |
Commit changes |
git rm -r [file-name.txt] |
Remove a file (or folder) |
git checkout -- [file-name.txt] |
Discard changes to a file |
git push origin [branch name] |
Push a branch to your remote repository |
git pull |
Update local repository to the newest commit |
git pull origin [branch name] |
Pull changes from remote repository |
git remote add origin ssh://[email protected]/[username]/[repository-name].git |
Add a remote repository |
git log |
View changes |
git log --summary |
View changes (detailed) |
git log --oneline |
View changes (briefly) |
git diff [source branch] [target branch] |
Preview changes before merging |