Mapa mental
2.4.6: Use Git Version Control to Save Our Work
Conteúdo do mapa
2.4.6: Use Git Version Control to Save Our Work
Ensure you're in the directory prework-study-guide
- cd bootcamp
- cd prework-study-guide
- code . to open VS Code
- cd prework-study-guide
- cd bootcamp
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
- Prefix feature to indicate that it is a feature
- git checkout -b feature/starter-code
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
- Before we push this up to our repo, double-check if our local branch is in sync with the base branch in GitHub
- git commit -m "add starter code"
- git add -A
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
- git pull prework-study-guide main --allow-unrelated-histories
- You should see fetch & push
- Verify git - git remote -v
- git remote add repo URL name.git
- Had to set a new remote, but to ensure your inside the bootcamp cd
Informações
- Descrição
- Mapa Mental sobre 2.4.6: Use Git Version Control to Save Our Work, criado por Frankie Balvert em 11-10-2022.
- Criado por
- Frankie Balvert
- Visualizações
- 0
- Avaliação