Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Git challenges

4,981 views

Published on

Small practices about Git.

Published in: Software

Git challenges

  1. 1. Git challenges Rachel M. Carmena
  2. 2. Rachel M. Carmena @bberrycarmen Differences ● Add a file and send it to the local repository ● Change the content of the file on workspace ● Get the list of changes ● Add the file to the staging area ● Change the content of the file ● Get the list of changes on workspace ● Get the list of changes on staging area
  3. 3. Rachel M. Carmena @bberrycarmen Merge and fast forward ● We are on branch A ● Create branch B ● Make changes on branch B ● Merge from B into A ● We are on branch A ● Create branch B ● Make changes on branch B ● Make changes on branch A ● Merge from B into A
  4. 4. Rachel M. Carmena @bberrycarmen Cleaning branches ● Create branch A (local and send to remote) ● Create branch B (local and send to remote) ● Create branch C (local and send to remote) ● Delete branch A only in local ● Delete branch B only in remote ● Delete branch C in local and remote
  5. 5. Rachel M. Carmena @bberrycarmen Using staging ● Create a branch in local repository ● Create several files ● Send to local repository ● Create new files ● Change existing files ● Distribute new files and changes in two different commits
  6. 6. Rachel M. Carmena @bberrycarmen Merge and conflicts ● Create a local branch A ● Create a local branch B ● Create the same file in both branches, with a difference in the same lines ● Merge from B into A and solve the conflict ● Merge from A into B and... what happens?
  7. 7. Rachel M. Carmena @bberrycarmen Undo changes ● Create a local branch ● Create files and make changes until having 3 commits in local repository ● Undo changes from second commit ● Send commits to remote repository ● Undo changes from one of the pushed commits
  8. 8. Rachel M. Carmena @bberrycarmen Pull = fetch + merge ● Create a branch A (local and remote) ● Create 2 working copies from the same repository (we want to simulate two people working on the same branch) ● Make changes in a working copy and send to remote ● Go to the another working copy and make changes in local repository ● Update the content – we want to answer the question “I’ve only updated my branch with pulling and one commit about merging has appeared in log, why?”

×