๐๐ถ๐ ๐๐๐๐ฒ๐ป๐๐ถ๐ฎ๐น๐: ๐ฌ๐ผ๐๐ฟ ๐ฐ๐ต๐ฒ๐ฎ๐ ๐๐ต๐ฒ๐ฒ๐ ๐ณ๐ผ๐ฟ ๐บ๐ฎ๐๐๐ฒ๐ฟ๐ถ๐ป๐ด ๐๐ฒ๐ฟ๐๐ถ๐ผ๐ป ๐ฐ๐ผ๐ป๐๐ฟ๐ผ๐น ๐จ๐ป
Whether you're a seasoned developer or just starting out, Git is an essential tool for seamless collaboration and efficient workflows. Here's a quick recap of the most common Git commands to keep you on track:
โจ๐๐ฒ๐๐๐ถ๐ป๐ด ๐ฆ๐๐ฎ๐ฟ๐๐ฒ๐ฑ:
git init: Initializes a new Git repository.
git clone <repo_url>: Clones an existing repository to your local machine.
๐๐ง๐ฟ๐ฎ๐ฐ๐ธ๐ถ๐ป๐ด ๐๐ต๐ฎ๐ป๐ด๐ฒ๐:
git status: Checks the status of files in your working directory.
git add <file> or git add .: Stages files for commit.
โ
๐๐ผ๐บ๐บ๐ถ๐๐๐ถ๐ป๐ด ๐ช๐ผ๐ฟ๐ธ:
git commit -m "message": Commits staged changes with a descriptive message.
๐๐๐ฟ๐ฎ๐ป๐ฐ๐ต๐ถ๐ป๐ด ๐ฎ๐ป๐ฑ ๐ ๐ฒ๐ฟ๐ด๐ถ๐ป๐ด:
git branch: Lists existing branches.
git branch <new_branch>: Creates a new branch.
git checkout <branch>: Switches to a different branch.
git merge <branch>: Merges changes from one branch into another.
git checkout -b <new_branch>: Creates and switches to a new branch.
๐จ๐ป๐ฅ๐ฒ๐บ๐ผ๐๐ฒ ๐๐ผ๐น๐น๐ฎ๐ฏ๐ผ๐ฟ๐ฎ๐๐ถ๐ผ๐ป:
git remote -v: Lists remote repositories.
git fetch origin <branch>: Fetches changes from a remote branch.
git merge origin/<branch>: Merges fetched changes into the current branch.
git push origin <branch>: Pushes local changes to a remote branch.
๐๐ง๐ฟ๐ฎ๐ฐ๐ธ๐ถ๐ป๐ด ๐๐ถ๐๐๐ผ๐ฟ๐:
git log: Shows a list of commits.
git log --oneline: Displays a condensed commit history.
โช๐จ๐ป๐ฑ๐ผ๐ถ๐ป๐ด ๐ ๐ถ๐๐๐ฎ๐ธ๐ฒ๐:
git revert <commit>: Reverses a specific commit.
git reset --hard HEAD: Resets the working directory to the last commit (use with caution!).
๐ง๐ฎ๐ด๐ด๐ถ๐ป๐ด ๐ ๐ถ๐น๐ฒ๐๐๐ผ๐ป๐ฒ๐:
git tag: Lists existing tags.
git tag -a v1.0 -m "tag": Creates a new tag for a specific commit.
โ๐๐ผ๐ป๐ณ๐ถ๐ด๐๐ฟ๐ฎ๐๐ถ๐ผ๐ป:
git config --global user. name "name": Sets your global Git username.
git config --global user. email "email": Sets your global Git email.
Post #1050
7.41K
- ๐ 11
- ๐ 3