


The git log command enables us to display a list of all of the commits on current branch. git commit -m “Commit to resolve merge conflict” -This will commit and comment will be added git log Using the “git commit” command only saves a new commit object in the local Git repository.
Git fetch a specific branch code#
It will not push code automatically to the remote server. The “commit” command is used to save our changes to the local repository. git add README.md -Will add README.md in repository git commit This command will add file to local repository. we can checkout for that specific branch. Example : We have multiple branches for our repository and we want to take code for any specific branch. The git checkout command is used to switch between branches in a repository. Git branch myfeaturebranch -this will create new branch in local repository git checkout new_feature is branch Other Important git commands git branch

Pushing is transferring commits from local repository to a remote repository. The git push command is used to upload local repository content to a remote repository. git pull - Fetch the specified remote’s copy of the current branch and immediately merge it into the local copy.
Git fetch a specific branch update#
The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content. It will download the remote content but not update local repo’s working state, leaving current work intact. The git fetch command downloads commits, files, and refs from a remote repository into local repository. Cloning a specific branch git clone branch Cloning to a specific folder git clone Ģ. Git clone is a git command line tool which is used to target an existing repository and create a clone, or copy of the target repositoryġ. Git has four network commands git clone, git fetch, git pull, and git push which work for local and remote repository. To set user email for local git repository use below commands git config -global user.email Git Network Command: To set user name for local git repository use below commands git config -global user.name "Dhanik Sahni" We should set some configuration before using git commands like user information. Git Commands : Local Environment Setup before using Git: We can utilize git commands for GitHub and TFS code as well. GitHub is home to the largest collection of open source projects in the world. GitHub serves as a community space where we can share our work, see our team’s work, complete code reviews, and connect integrations that help us build, test, and deploy our code. Github is collaboration platform built on top of Git. Distributed version control systems give developers flexibility and freedom by providing every collaborator with a copy of the entire repository at any time, including all branches (lines of work) and commits (saved points in history) on a developer’s local machine. Git is distrbuted version control system. We can use TFS or Git for versioning control. Version Control is important for Team-Based Development for every organization.
