DEV Community

Cover image for 🔥 10 Git Commands Every Developer Should Know 👨🏻‍💻
Codeziper
Codeziper

Posted on

🔥 10 Git Commands Every Developer Should Know 👨🏻‍💻

Git Commands 📢

1.Create a new local repository

git init
Enter fullscreen mode Exit fullscreen mode

2.List new or unmodified files.

git status
Enter fullscreen mode Exit fullscreen mode

3.Stage all changed files

git add .
Enter fullscreen mode Exit fullscreen mode

4.Stage a file

git add < File >
Enter fullscreen mode Exit fullscreen mode

5.Commit previously staged changes

git commit
Enter fullscreen mode Exit fullscreen mode

6.Switch to a branch and update

git checkout < Branch Name >
Enter fullscreen mode Exit fullscreen mode

7.Check the current branch

git branch
Enter fullscreen mode Exit fullscreen mode

8.Fetch a remote version of a branch and update it locally.

git pull < Remote > < Branch Name >
Enter fullscreen mode Exit fullscreen mode

9.Push the committed changes to a remote repository.

git push < Remote > < Branch Name >
Enter fullscreen mode Exit fullscreen mode

10.Merge the specified branch into the current working branch.

git merge < Branch Name >
Enter fullscreen mode Exit fullscreen mode

Help me out! 💡

If you found this article helpful in providing a concise understanding of Git commands, I would greatly appreciate it if you could show your support by giving it a ❤️. Your positive feedback encourages me to create more valuable content.
And feel free to share your thoughts in the comments section below.!! 💬


Thank you for your interest!😊
Team Codeziper 🎉

Top comments (0)