Total Pageviews

Search This Blog

Copyright to Cloud TechNet organization . Powered by Blogger.

Pages

Blogger templates

Monday, 20 February 2023

Git basic commands


 Here are some basic Git commands that you can use to manage your code repository:

  1. git init: Initializes a new Git repository in the current directory.

  2. git clone <repository_url>: Clones an existing Git repository from the specified URL.

  3. git add <file_name>: Adds the specified file to the staging area.

  4. git add .: Adds all modified and new files to the staging area.

  5. git commit -m "<commit_message>": Commits the changes in the staging area to the repository, with the specified commit message.

  6. git push: Pushes the changes from your local repository to the remote repository.

  7. git pull: Pulls the changes from the remote repository to your local repository.

  8. git status: Shows the status of the current branch and any modified or untracked files.

  9. git log: Shows the commit history for the current branch.

  10. git branch: Shows a list of all branches in the repository, with an asterisk next to the currently checked out branch.

  11. git checkout <branch_name>: Switches to the specified branch.

  12. git merge <branch_name>: Merges the specified branch into the current branch.

These are just a few of the basic Git commands. Git has many more commands and options that can be used to manage and collaborate on code repositories.

0 comments:

Post a Comment