Challenge 2 – ChatGPT vs Me

In the last challenge, it was so much easier to use ChatGPT than to create an article myself.
In true agile spirit, I resigned quickly.

The new challenge is to make the content even simpler. Would I be able to create a brief article that
surpasses ChatGPT use?

Topic

The topic chosen relates again to Git; this time, the challenge is: –
Highlight GIT commands on the local Repository for a beginner.

Me: My attempt

The following typically will be the main commands to get a beginner started using Git on the local
workstation.

The commands are the main commands to create a local git repository, create a single text file;
add the file to the staging; commit the file to the repository. This will be followed by some extremely useful commands to view the local repository etc. To keep the article short, it is suggested that these commands be reviewed and further investigated by the reader.

  • git init
  • code .\<first text file>.txt
  • git add .
  • git commit -m “<first text file>.txt commit”

The following are the useful command that should be known.

  • git –version #checks the version number
  • git config –global –list #lists the global configuration
  • git config –global user.name “Donald Duck” #updates the user name
  • git config –global user.email dd@disney.com #updates the user email address
  • git config –global init.defaultBranch main #used to set default branch to main
  • git status #show the status
  • git diff –cached #delta of staged and committed
  • git log #shows the full commit


ChatGPT: Response

The prompt supplied was:
Highlight GIT commands on the local Repository for a beginner.

Chat GptResponse was:

Here are some commonly used Git commands for beginners to use on a local repository:

1) git init: Initializes a new Git repository in your current directory.

2) git add: Adds changes or new files to the staging area for Git to track.

3) git commit: Saves changes to the local repository with a commit message describing the changes.

4) git status: Shows the status of your local repository, including which files are staged or modified.

5) git log: Displays the commit history of the repository.

6) git branch: Lists all branches in the repository, with an asterisk indicating the currently active branch.

7) git checkout: Switches to a different branch in the repository.

8) git merge: Combines changes from one branch into another.

9) git pull: Fetches and merges changes from a remote repository into your local repository.

10) git push: Sends changes from your local repository to a remote repository.

These are just a few examples of the many Git commands available. It’s recommended to learn Git gradually, starting with the basics and gradually learning more advanced commands as you become more comfortable with the system

Winner ?

At least I am in the game with this one; there is no need to concede defeat immediately. You can decide for yourself.

The ease of ChatGPT was impressive; however, if I were a school teacher, I would take off some marks as the response did not fully address the question.

We both should have included diagrams.

Score ChatGPT 1.5 : 0.5 Me