Top 10 GIT Commands

top-10-git-commands

after discussing what is git in the previous article, in this article we are mentioning the most 10 commands you need to get started with GIT

git init:

Initializes a new Git repositry in the current directory

git clone [repository_url]:

Clones an existing Git repository from the specfied URL to your local machine

git add [file(s)]:

Stages changes for commit. Use git add . to stage all changes in the current directory.
git commit -m “commit message”:

Commits the staged changes along with a descriptive commit message.

git pull:

Fetches changes from a remote repository and merges them into the current branch.

git push:

Pushes your local commits to the remote repository.

git branch:

Lists all branches in your repository. Use -r to see remote branches and -a to see all branches.

git checkout [branch_name]

Switches to the specified branch. You can also use this command to create a new branch.

git merge [branch_name]

Merges changes from the specified branch into the current branch.

git log:

Shows a log of all commits in the current branch, including commit hashes, authors, dates, and commit messages. Use –graph for a visual representation of branching.

These commands provide the basic functionality needed to work with Git effectively.
Depending on your workflow and project requirements, you may need to use additional Git commands and options for more advanced tasks.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
sqlite-with-python

SQLite with Python

Next Post
x-creator-pay:-is-x’s-ad-revenue-pay-worth-it-for-content-creators?

X Creator Pay: Is X’s Ad Revenue Pay Worth it for Content Creators?

Related Posts