Skip to content

GiadaGiuliaPaola/Caro-Nonno-Pizzeria

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Push Practice: Understanding Branching This repository serves as a hands-on learning experience to solidify your understanding of Git branching and pushing.

Learning Objectives:

Practice creating and switching between branches. Understand the behavior of git push in relation to branches. Grasp the concept of pushing changes from specific branches. Steps:

Create a Branch for Experiments:

Execute git checkout -b spicy-experiments to create a new branch named "spicy-experiments" and switch to it. Experiment and Commit (spicy-experiments branch):

Make changes you want to experiment with on this branch. Stage the changes using git add <file_names>. Commit the changes with a descriptive message using git commit -m "". Push Your Experiments:

Run git push to push the committed changes from the "spicy-experiments" branch to the remote repository. This should succeed without any issues. Switch to Main Branch:

Use git checkout main to switch back to the "main" branch. Create and Commit Changes (main branch):

Make and commit two separate changes in the "main" branch, following the steps described in step 2. Attempt Push and Observe (main branch):

Try pushing the changes from the "main" branch using git push. You should see a message saying "Everything up-to-date". Explanation:

This message indicates that there are no new commits to push on the "main" branch because git push by default only pushes changes from the branch you are currently on. Since you were on the "spicy-experiments" branch when you tried to push, the "main" branch changes weren't pushed. Push Changes from Main Branch:

Switch back to the "main" branch using git checkout main. Now, running git push will successfully push the latest commits from the "main" branch to the remote repository. VS Code "Sync Changes":

Similar to git push, the VS Code "Sync Changes" button also operates based on the current branch you are working on.

Key Takeaways: -Git pushes changes from the branch you are currently on by default. -It's recommended to push branches individually for better version control and tracking. -This exercise allows you to experiment and solidify your understanding of how Git handles push operations within the context of branches. -Feel free to explore further and practice creating and managing branches in your Git workflow to enhance your proficiency.

About

winc exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published