Who has used SVN, CVS or Microsoft SourceSafe?Point out that one of the main differences is DISTRIBUTED
Speak to some generic examples of this architecture.
Can stage individual lines of a file for commit.
Git records your name and email address with every commit you make.So the first step is to tell Git what these are.
Stage and Unstaged changesAgainst HeadBetween branches
git commit -a automatically stage all tracked, modified files before the commit -> SVN-like approach
There is some work involved to support this synchronization which is why a lot of teams use Github or something similar.Github also provides a great way to host your code for others to get too without a lot of hassle.
Keep in mind it’s not like SVN where you get new files from repo – you are just changing pointer in tree.git checkout <branchname> -> is also how you switch between branches
Rememberorigin is an aliasCan now do PUSH to remote
git branch :existing branches are listed and the current branch will be highlighted with an asterisk. There are some options can pass as well – not going into thosegit branch <branchname> :creates a new branch head named <branchname> which points to the current HEAD, or <start-point> if giventhis will create the new branch, but it will not switch the working tree to it; use "git checkout <newbranch>" to switch to the new branch.git branch –d <branchname> : deletes branchcan also rename, set upstream to track, etc
Is a LIFO stack
Commit history – everything is always in the repo and you are pointing to a point in the history
Getting Git...before it gets you
GETTING GIT…before it gets you
HOW TO BE GOTTEN I am „notmessenger‟ in most networks and notmessenger.com/contact has the rest of the ways to find me
IT‟S THE NEW HOTNESS! Source code management system Version control and …. Distributed!
DISTRIBUTED? There is no central server where your repository must be maintained Also referred to as being “Decentralized” Everything you need to maintain a repository is already on your local machine (once you have installed Git)
Git doesn‟t have a central server, such as how SVN or others do You collaborate by synchronizing with other repositories There is no real difference between a server and client – a Git repository is a Git repository and you can synchronize between any two easily
CHECKOUT Checkout a branch from a remote repository to working directory Example: > git checkout <branchname>
FETCH Download new branches and data from a remote repository Is a separate copy of the data from the remote repository – it is not merged with your local working copy Can then look through new commits, view logs, etc Example: > git fetch > git fetch [alias] > git fetch --all
PULL First issues a FETCH command and then a MERGE command Example: > git pull > git pull [alias] > git pull --all
PUSH Push your new branches and data to a remote repository If someone else has pushed since the last time you fetched and merged the Git server will deny your push until you are up to date Example: > git push [alias] [branch]
MERGE Merge any branch into the current branch Example: > git merge <branchname> > git merge --no-commit <branchname>
STASH Takes the dirty state of your working directory and saves it on a stack of unfinished changes that you can reapply at any time Example: > git stash > git stash list > git stash apply <stashname> > git stash drop <stashname>
LOOKOUT! A few of the differences between it and previous generations of SCMs The index (or stage) Distributed Commit history Git is the new hotness and is being used (virtually) everywhere