10 Command Git yang Wajib Kamu Ketahui

Git Init

git init
git init <directory>

Git Clone

git clone <repo-url>
git clone --branch <tag/branch-name> <repo-url>

Git Branch

git branch
git branch <branch-name>
git branch -d <branch-name>

Git fetch

git fetch <remote>
git fetch <remote> <branch>
git fetch --all

Git Checkout

git checkout <branch-name>
git checkout -b <branch-name>
git fetch --all
git checkout <branch-name>
git checkout <log> <file-name>

Git add

git add <file>
git add <file> <file> <file>
git add *.html
git add <directory>
git add .

Git commit

git status
git commit -m "<commit-message>"

Git push

git remote add <name> <url>
git push <remote> <branch># ataugit push --set-upstream <remote> <branch>
git push

Git pull

git pull <remote>
git pull

Git Merge

git checkout <main-branch>
git merge --no-ff <new-feature-branch>

Additional

Ignoring Files

Tetap Terhubung dengan Kami
Share this
×