Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Git Commands To Know As A Developer [Cheatsheet for Beginners] 👨‍💻📑

Posted on Aug 25 Done with remembering Git commands? Check out this cheat sheet with 10 commands to make your life easier as a code newbie.You before this post -You after this post -Repository: This is where all your project's files, changes, and different versions are stored.Branch: It's like a separate copy of your project where you can work on a specific version. The main branch is often called "master."Commit: Think of it as a single snapshot of the changes you've made to your project in a branch.Checkout: This is how you switch between the current version you're working on and another version in your project.Master: The main version of your project, usually referred to as the "master" branch.Merge: When you combine changes from one branch into another to keep everything up to date.Fork: A clone of a repository that you can work on independently.Head: The most recent snapshot of your project that you're currently working with.To start a new project or set up version control in an existing project, you use this Command. It creates a repository either in the current folder or the specified folder.This command copies an existing repository to your computer. If you provide a repo URL, it copies to the current location. If you want it in a different location, include a folder path.When you want to prepare changes to be saved, this command comes in handy. It stages the changes in a directory or a file. Usually followed by git commit and git push.After staging changes, this command commits them with a message explaining the changes. You can also use -am to add and commit changes together.To send your committed changes to the main repository, you use this command.To see the differences between your current changes and the last committed version, you use this command. You can also compare staged changes with the latest version using -staged, or specify a file to compare.This command is used to fetch changes from the original branch and merge them into your local branch.Similar to git pull, this command gets the latest changes from the main branch, but it doesn't automatically merge them.This shows the history of your commits in a default format, letting you see what changes have been made over time.This helps you know the status of your files, whether they're ready to be committed, changed, or untracked.Use this official cheatsheet of Git for more commands.I hope this article has helped you in learning about Git. Thanks for reading the article! Don't forget to bookmark this post for reference in the future!Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Luis Juarez - Jul 28 Muhammad Harith Zainudin - Aug 7 Bap - Aug 4 Rizèl Scarlett - Aug 5 Once suspended, arjuncodess will not be able to comment or publish posts until their suspension is removed. Once unsuspended, arjuncodess will be able to comment and publish posts again. Once unpublished, all posts by arjuncodess will become hidden and only accessible to themselves. If arjuncodess is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Arjun Vijay Prakash. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag arjuncodess: arjuncodess consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging arjuncodess will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Git Commands To Know As A Developer [Cheatsheet for Beginners] 👨‍💻📑

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×