Git clone is a command for downloading existing source code from a remote repository (like Github, for example). In other words, Git clone basically makes an identical copy of the latest version of a project in a repository and saves it to your computer.
We can use the git branch command for creating, listing and deleting branches.By using branches, several developers are able to work in parallel on the same project simultaneously.
this command is used to view the list of branches
this is used to delete a branch
Git checkout is mostly used for switching from one branch to another. We can also use it for checking out files and commits.
This command allows us to create and switch to a branch at the same time
The Git status command gives us all the necessary information about the current branch.This includes :
Whether the current branch is up to date
Whether there is anything to commit, push or pull
Whether there are files staged, unstaged or untracked
Whether there are files created, modified or deleted
When we create, modify or delete a file, these changes will happen in our local and won't be included in the next commit (unless we change the configurations).We need to use the git add command to include the changes of a file(s) into our next commit.
This command is used to add all the changes at once
Git commit is used to save the changes when we reached the pparticular point of development.It is like setting a checkpoint in the development process which you can go back to later if needed.
After committing your changes, the next thing you want to do is send your changes to the remote server. Git push uploads your commits to the remote repository.
This command is used to push our code to the newly created branch
The git pull command is used to get updates from the remote repo. This command is a combination of git fetch and git merge which means that, when we use git pull, it gets the updates from remote repository (git fetch) and immediately applies the latest changes in your local (git merge).
This command is used to undo the commits.In other words it revert back the changes that we made locally or remotely
this command is used to see the commit history
This command is used to temporarily save changes that you have made in your working directory, but have not yet committed, to a new stash. This allows you to switch to a different branch or to return to a clean state without losing your changes.
name: The name of the stash. If no name is specified, a default name will be used.
This command lists all the stashes that you have created.
name: The name of the stash you want to apply.
name: The name of the stash you want to delete.
This command is used to merge the another branch with the current branch. The code present in the current branch and merged branch will be merged.
This command is used to create an empty git repository or to initialize and existing repository.
This command is used to configure the username and email of the person working on the local repository.
This command is used to configure the username
This command is used to configure the email
This command is used to get the total history of the repository. It provides the list of all the commits and for each commit it provides the username, date of commit, commit title and commit-hash.
To get each commit details in oneline
To get the list of files modified and no. of lines modified in each commit
To get the list of files modified and also the location of the lines removed of added in the file
To get the graph of the commits made Each node of graph represents a commit
To view last n commit details
This command is used to view the difference between the files in the one commit and another commit.
To view the changes between two different commits
To view the changes between two different branches
This command will download the changes from the remote repository to the local repository. This will get the updates that are made to the remote repository into the local repository. This will only download the change and does not merge the changes.
This command is used to fetch a remote repo
This command is used to fetch a specific remote branch
This command is used to fetch all the branches
This command is used to undo the changes. This will reset the current state of the HEAD to any specific state.
This command is used to used to delete a file or files from the repo
This command is used to delete the file form git, but to preserve the file in the local system
This command is used to tag a commit and tag can be refered in future. A branch can have any number of tags. Tags can be names of the versions.
This command is used to create a tag
This command is used to list the tag names
This command is used to push a specific tag to remote repo