在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ga-wdi-boston/git开源软件地址:https://github.com/ga-wdi-boston/git开源编程语言:开源软件介绍:Git BasicsObjectives
PrerequisitesWhy GitVersion control! As developers our code is our livelihood so it's important that we safely store our work... frequently. Not only that we want to track our changes as we make them. If we make a feature that ends up breaking the rest of our app we want to be able to go back to a point when our app was last working. Code Along: Making a Local RepositoryLet's initalize a local repository.
House Stark of Winterfell is led by the just Eddard "Ned" Stark, Lord of
Winterfell, Warden of the North, Hand of the King, Protector of the Realm,
Regent. He is surely honorable and will lead a long and prosperous life.
Code Along: Staging and CommitingUsing There are 3 states that your file can reside in
When we add a file we are moving it from the working directory to the staging area. Now that our file is staged let's commit our file by typing When you use -m to create an inline commit you are doing yourself and others a disservice. Your commit will be inherently poor due to the short nature of inline commits, and the lack of a body description to it. This is surely a sign of a poor developer and one that does not respect his or her teammate's time. Lab: Crafting A CommitRead over the following blog posts and carefully think about what a good commit message would be. Take some time to come up with your own. Be ready to share your commit with the rest of the class. Now that we've made our first commit, let's see what happens when we type Staging: And He Lived Happily AfterTogether, let's continue our story. In our Ned Stark went to King's landing where he made lots of friends and lived
happily ever after... He definitely didn't get axe murdered. Now using what we learned earlier stage this change. To figure out the status
of your files you can type Remember: Staging isn't commiting Unstaging: Maybe We Jumped the GunIt turns out Ned actually did get axe murdered. So we probably want to unstage our file. Unstage the file with Delete the last thing we wrote in We know that Ned's story doesn't have a happy ending but let's dream big. We're going to create a dream-story branch and write what we would have wanted to happen. Removing: Now we need to remove files previously added
What's the difference? What is actually happening with the Branching: Multiple Stories, One Main PlotSimilar to having one main story and various sub-plots--a branch lets us
effectively duplicate and section off the code we have writte thus far, make
alterations to it, and if we would like at some point we can join it back to the
main branch (typically called Create a branch called Now that we've created our branch--in order to use it we have to switch to it.
We can do this with the command Lab: Branching Your Dreams1.Switch to your 2.Save the file, Stage and commit your changes. 3.Switch back to your 4.Stage and commit your changes. (Be ready to talk about any issues you many have encountered or strange things you may have noticed). Code Along: Learn Git BranchingNow let's take 10-15 minutes and go through Learn Git Branching together. Git Workflow Checklist
Git Best Practices
ReferencesLicense
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论