I'm always excited to take on new projects and collaborate with innovative minds.
98/4 Pravesh Vihar Shastri Nagar, Meerut
Git is a powerful version control system that helps developers track changes in their code, collaborate with others, and maintain a clean history of their projects.
Git is a powerful version control system that helps developers track changes in their code, collaborate with others, and maintain a clean history of their projects. Below is a list of essential Git commands you should know when starting out.
git init
Creates a new Git repository in your current directory.
git clone <repository_url>
Downloads a project and its entire version history from a remote repository.
git status
Displays the state of your working directory and staging area.
git add <filename>
# OR to add all files:
git add .
Stages changes for the next commit.
git commit -m "Your commit message"
Saves your staged changes with a descriptive message.
git log
Shows the history of commits made to the repository.
git push origin <branch_name>
Uploads your commits to a remote repository like GitHub or GitLab.
git pull
Fetches and merges changes from the remote repository into your local branch.
git branch <branch_name>
Creates a new branch.
git checkout <branch_name>
# OR in newer versions:
git switch <branch_name>
git checkout -b <branch_name>
# OR in newer versions:
git switch -c <branch_name>
git merge <branch_name>
Merges another branch into your current branch.
git branch -d <branch_name>
Deletes a branch locally.
git checkout -- <file_name>
Reverts a file to the last committed version.
git remote -v
Displays the URLs of remote repositories connected to your local repo.
Your email address will not be published. Required fields are marked *