GoConqr has a new look! Let us know what you think.

Mind map

2.4.6: Use Git Version Control to Save Our Work

Frankie Balvert English

Map content

2.4.6: Use Git Version Control to Save Our Work

  1. Ensure you're in the directory prework-study-guide

    • cd bootcamp
      • cd prework-study-guide
        • code . to open VS Code
  2. git status - to check what branch we're working in

    • git checkout -b feature/starter-code
      • The checkout command is to move the working branch to a new branch
      • The -b flag creates a new branch
      • The feature/starter-code is the name of the new branch
        • Prefix feature to indicate that it is a feature
          • feature helps to indicate the purpose of each branch
  3. To add the starter code to the current working branch

    • git add -A
      • The add command adds modifications in the current working branch to the staging area
      • The -A flag indicates that we want to add all changes
      • Now that we have staged those files to be committed enter git commit command with a commit message that describes what the commit contains
        • git commit -m "add starter code"
          • Before we push this up to our repo, double-check if our local branch is in sync with the base branch in GitHub
            • To pull down any changes from the base branch
  4. ISSUES

    • Had to set a new remote, but to ensure your inside the bootcamp cd
      • git remote add repo URL name.git
        • Verify git - git remote -v
          • You should see fetch & push
            • git pull prework-study-guide main --allow-unrelated-histories
              • When git pull use --allow-unrelated-hstories to override
              • git push prework-study-guide feature/starter-code

Information

Description
Mind Map on 2.4.6: Use Git Version Control to Save Our Work, created by Frankie Balvert on 11/10/2022.
Created by
Frankie Balvert
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?