Git basic commands
Here are some basic Git commands that you can use to manage your code repository:
git init: Initializes a new Git repository in the current directory.git clone <repository_url>: Clones an existing Git repository from the specified URL.git add <file_name>: Adds the specified file to the staging area.git add .: Adds all modified and new files to the staging area.git commit -m "<commit_message>": Commits the changes in the staging area to the repository, with the specified commit message.git push: Pushes the changes from your local repository to the remote repository.git pull: Pulls the changes from the remote repository to your local repository.git status: Shows the status of the current branch and any modified or untracked files.git log: Shows the commit history for the current branch.git branch: Shows a list of all branches in the repository, with an asterisk next to the currently checked out branch.git checkout <branch_name>: Switches to the specified branch.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