IT managers have to deal extensively with strategic matters, but it is always important to have some knowledge of code, and this step-by-step guide shows how Git is used 90% of the time. This example simulates using the C# language with Visual Studio. However, the following process applies to any other programming language.
Getting Started with Git
- Install Git on the machine, selecting the second configuration option in the Git download
- Open a DOS command prompt
- Configure the name: git config user.name “UserName”
- Configure the email: git config user.email “username@rn.gov.br”
- Clone the project: git clone url.git
- Enter the cloned system’s folder: cd pasta_do_sistema
- Create the dev branch: git branch dev
- Switch to the dev branch: git checkout dev
- Download dev from the server into local dev: git pull origin dev
From here, you can open the project in Visual Studio and run it.
Making Changes to Projects with Git
- When you arrive at work, update your local project with the latest changes from the server: ‘git pull origin dev’
- Make changes to the source code via VisualStudio
- Follow the next two steps to add your changes to the local repository:
- git add .
- git commit -m “atualização no formulário de cadastro de curso”
- Send them to the server: git push origin dev
Keep repeating this flow for as long as the project lasts.
Publishing a Project with Git
- Configure the server address in VisualStudio
- On the dev branch, right-click the interface project and click Publish
- Verify that the project is working correctly.
- If the project worked correctly, update the master branch as follows:
- Access the master branch: git checkout master
- Execute the merge: git merge dev