This content originally appeared on DEV Community and was authored by Emmanuel
Git
Git is a distributed version control system, which means that a local clone of the project is a complete version control repository. These fully functional local repositories make it easy to work offline or remotely. Developers commit their work locally, and then sync their copy of the repository with the copy on the server. This paradigm differs from centralized version control where clients must synchronize code with a server before creating new versions of code.
Git’s flexibility and popularity make it a great choice for any team. Many developers and college graduates already know how to use Git. Git’s user community has created resources to train developers and Git’s popularity make it easy to get help when needed. Nearly every development environment has Git support and Git command line tools implemented on every major operating system.
Benefits of Git
Simultaneous development: Everyone has their own local copy of code and can work simultaneously on their own branches. Git works offline since almost every operation is local.
Faster releases: Branches allow for flexible and simultaneous development. The main branch contains stable, high-quality code from which you release. Feature branches contain work in progress, which are merged into the main branch upon completion. By separating the release branch from development in progress, it’s easier to manage stable code and ship updates more quickly.
Built-in integration: Due to its popularity, Git integrates into most tools and products. Every major IDE has built-in Git support, and many tools support continuous integration, continuous deployment, automated testing, work item tracking, metrics, and reporting feature integration with Git. This integration simplifies the day-to-day workflow.
Strong community support: Git is open-source and has become the de facto standard for version control. There is no shortage of tools and resources available for teams to leverage. The volume of community support for Git compared to other version control systems makes it easy to get help when needed.
Git works with any team: Using Git with a source code management tool increases a team’s productivity by encouraging collaboration, enforcing policies, automating processes, and improving visibility and traceability of work. The team can settle on individual tools for version control, work item tracking, and continuous integration and deployment. Or, they can choose a solution like GitHub or Azure DevOps that supports all of these tasks in one place.
Pull requests: Use pull requests to discuss code changes with the team before merging them into the main branch. The discussions in pull requests are invaluable to ensuring code quality and increase knowledge across your team. Platforms like GitHub and Azure DevOps offer a rich pull request experience where developers can browse file changes, leave comments, inspect commits, view builds, and vote to approve the code.
Branch policies: Teams can configure GitHub and Azure DevOps to enforce consistent workflows and process across the team. They can set up branch policies to ensure that pull requests meet requirements before completion. Branch policies protect important branches by preventing direct pushes, requiring reviewers, and ensuring clean builds.
Github
GitHub is a cloud-based platform for version control and collaboration, primarily used by developers to store, manage, and share code. It is built on Git, an open-source version control system that tracks changes in code and allows multiple people to collaborate on a project efficiently.
Git Bash
Git Bash is an application for Microsoft Windows OS environments that provides Unix based shell utilities and experience for Git command line commands. Git Bash emulates the Git command line experience that Unix environments have, for Windows users. Most Windows users download Git Bash when they first install Git for Windows.
As a version control system, Git was originally delivered within Unix style command line methods. MacOS & Linux Operating Systems have a built-in terminal shell that supports Unix-based command line features whereas Microsoft Windows’ Operating System command line prompt is not a Unix-based terminal. Because the Windows command line does not support Unix-based commands, Git CLI features are mostly delivered with user-friendly GUI applications in the Windows Operating System. These applications provide visual functionalities to the end-user which makes using Git easier.
As Git experience increases, end-users can prefer using Git command line features for specific commands. Git Bash is one tool that provides command line features in the Windows Operating System to end-users.
Essential Git Bash Commands:
1.GIT PUSH: This command is used to upload local repository content to a remote repository. (In Git, a local repository is a version-controlled directory on your local computer where your project files are stored, along with the metadata Git uses to track changes to these files.)
2.GIT COMMIT -M: This takes a snapshot of your repository at one point in time. The -m flag helps u add a message to the commit
3.GIT ADD As the name implies it adds a change in the working directory to the staging area. It tells git that u want to include updates to a particular file.
4.GIT REMOTE ADD ORIGIN: This creates a new empty Git repository on your remote server.
Steps on how to use Git BASH command to create a sample resume and push it to Github pages
1.To install Git for windows, click on this link https://git-scm.com/downloads/win
2.Click on windows version to download and install Git for windows.
3.Go to download, choose the downloaded git version for windows, click to install ,choose Next throughout as default to complete the installation.
4.when the installation is complete, open your gitbash to Configure the Gitbash with an Identity, to do that create a name and email with the following commands:
git config –global user.name “name”
git config –global user.email “email”
5.Use this command git config –list to confirm if the configuration is successful. From our gitbash it shows its successful.
6.Prepare your work environment to work with it. To do that, create/make a directory.(Its similiar to what Resource group does in microsoft Azure).To make directory, run this command mkdir emmanuelobinnadirectory in your gitbash.
7.To see things that is in your computer or things you have created use ls command in your gitbash
8.Enter/open the emmanuelobinnadirectory we have created, use cd emmanuelobinnadirectory command
9.
9.Type this command clear your gitbash to clear the screen but its important to note that ,it doesnt mean your previous command have been deleted.
9.In your gitbash type this command git init to convert your directory into a local git repository.
10.To confirm that it has been converted. Type this command ls -al in your gitbash to list the hidden files,.
11.In your gitbash, type this command touch index.html to Create an empty text file/html file.
12.To verify that we have created the touch index.html file use the command ls in your gitbash.
13.Go to chatGPT, upload your resume on your chatGPT, or you can ask chatGPT to create an index.html for cloud engineering resume for Emmanuel obinna Onyemuche.
14.Go to gitbash, use the command vi index.html to open this index.html to start typing.
15.In other to edit vi file ,you have to make it to be on insert mode by typing i
16.Go to chatGPT and copy the code generated on the chatGPT and paste it, in the gitbash.
17.Click escape key on the keyboard to save the vim document.
18.Press shift+colon on your keyboard at the same time, then type wq in front of the colon. Hit enter on the keyboard.
w= is used to save everything.
q= is used to escape the page.
19.Got to github.https://github.com/..sign in to your github or signup if you have not gotten a github account. Go to +create to create a new repository.
20.Give the repository a name,choose the visibility to be public,make sure Add README is on and create the repository.
21.on your Github, after creating the new repository, click on code and copy the https https://github.com/EMMANUELOBINNAONYEMUCHE/Cloud-Engineer-Resume.git
22.Go to back to your gitbash and type this command git remote add origin “url” (https://github.com/EMMANUELOBINNAONYEMUCHE/Cloud-Engineer-Resume.git)
23.Use git status to verify there is a file.
24.Take the file to the staging area by using a command git add .
25.Type git status command on your gitbash to verify it has been added to the staging area.
26.Type the command git commit -m “a commit message” to take a snapshot of the entire file in the staging area and save it.
27.In the gitbash, type the command git push origin master to push it to the github. It will prompt a page, asking you to sign in to github. Choose sign in through the browser
28.Login to your github, while its pushing it to your github, after you have logged in, check your gitbash for confirmation that the push to the github is successful.
29.In your github, switch to master from main because we pushed it to master in our gitbash.
30.In your github, click on the index.html that you created.
31.When you open it, you will notice that everything that you did in you local environment was brought up to github.
32.Select settings.
33.On the left hand side look for Pages and click on it. On the branch, select master and save.
34.Refresh the page to see a link or visit site copy the link and paste on new browser or click on visit site to the Resume
The Resume
This content originally appeared on DEV Community and was authored by Emmanuel