
Every mainstream development tool supports this and will be able to connect to Azure Repos to pull down the latest source to work with. Getting a local copy of a Git repo is called “cloning”. In a browser tab, navigate to your team project on Azure DevOps. Git config -global user.email 2: Cloning an existing repository If you have already configured a credential helper and Git identity, you can skip to the next task.įrom the main menu, select Terminal | New Terminal to open a terminal window.Įxecute the command below to configure a credential helper. In this task, you will configure a Git credential helper to securely store the Git credentials used to communicate with Azure DevOps. This lab requires you to complete task 1 from the prerequisite instructions (Skip cloning, it is done in the exercise).Įxercise 1: Configuring the lab environment
#BACK FILE AS MASTER GIT CODE#
Visual Studio Code with the C# extension installed. You will use Visual Studio Code, but the same processes apply for using any Git-compatible client with Azure DevOps. In addition, you will learn about Git branching and merging support.
#BACK FILE AS MASTER GIT HOW TO#
In this lab, you will learn how to establish a local Git repository, which can easily be synchronized with a centralized Git repository in Azure DevOps. You should use Git for version control in your projects unless you have a specific need for centralized version control features in TFVC. Git is the default version control provider for new projects. Developers can commit each set of changes on their dev machine and perform version control operations such as history and compare without a network connection. Each developer has a copy of the source repository on their dev machine. Git repositories can live locally (such as on a developer’s machine). Git: Git is a distributed version control system. Branches are path-based and created on the server. Historical data is maintained only on the server. Typically, team members have only one version of each file on their dev machines. Team Foundation Version Control (TFVC): TFVC is a centralized version control system. Here is a quick overview of the two version control systems: Back to the past.Azure DevOps supports two types of version control, Git and Team Foundation Version Control (TFVC). They are just playing hide and sneak because you told them to. git folder and start over.” Your changes aren’t “gone”. This is why people say “don’t delete your. These HEAD and masters pointers are just that… pointers. Notice how HEAD and master pointers just move back to that commit ID. We just told git to hide them from ourselves, but not from git. Notice how the commits for files 4, 5, and 6 are there, but just dotted out (or whatever the official term is). Let’s learn some magic tricks using the git visualization tool at Īlrighty. How on earth is this possible?! I give up. In fact, if we do a `git log` we’re back to where we were at. You’re going to do another git reset, but this time, you’re going to change history by rolling forward instead of rolling backwards.Īnd all our files are back.

The lightbulb moment for me was that git was keeping those commits around, and not to mention git is also keeping an actual log of everything going on alongside my repo’s git log.


The command`git reflog` will show you the actual history of your git commands AND THEIR COMMIT IDS!! Will the real Git Log please stand up? please stand up. In addition,`ls` and `git ls-files` shows how files 5 and 6 are “gone”! Notice how the above image confirms the git log only shows the commits up to file 4. git revert undoes a commit by creating a new commit with those changes uncommitted (wow, what a sentence.git reset changes history and should be avoided if you’ve already shared those commits with others (e.g.Note: any flavor of git reset will work for today’s scenario, since we’re not making any changes in our working directory (or so I think). Now let’s say you did a `git reset –hard ` to reset back to file 4. Using yesterday’s tip, suppose you have a repo with 6 files each with their own commit.Ĭool. Note: I use the git visualization tool at the bottom of this post, in case you want to jump straight to the “How on earth is this possible?! I give up.

Git is about to make just a bit more sense. If you don’t know about git reflog, your life is about to get much, much better.
