Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Added: | ||||||||
> > | ||||||||
Git Guide | ||||||||
Changed: | ||||||||
< < | Created by Linus, it's a great versioning system for software. Especially useful when you have lots of people developing simultaneously on lots of different versions of software. Used from large projects such as the linux kernel down to a paper written in latex between a few people. | |||||||
> > | IntroductionGit was created by Linus![]()
| |||||||
Obtaining | ||||||||
Changed: | ||||||||
< < | You can get Git easily using Macports. Search for it port search git . | |||||||
> > | Available in linux. You can get Git easily using Macports. Search for it port search git . | |||||||
Using | ||||||||
Changed: | ||||||||
< < | Typically command line. A great free GUI is SourceTree![]() | |||||||
> > | There are two ways to use git 1) through the command line / terminal, and 2) through a graphical user interface (GUI). Working in the terminal first is a good step as you understand what's going on. Working with a GUI is sometimes convenient and a mixture of both may be quite productive.
Through the TerminalYou can use git by typinggit followed by a selection of commands. These should be executed from the root folder of your repository - not any subfolder.
Through a GUI - ie SourceTreeA great free GUI is SourceTree![]()
Guide
![]() | |||||||
Changed: | ||||||||
< < | Webpage guide I found here![]() | |||||||
> > | First Steps | |||||||
Changed: | ||||||||
< < | Stick to this convention![]() | |||||||
> > |
| |||||||
Changed: | ||||||||
< < | My notes below: | |||||||
> > |
| |||||||
Changed: | ||||||||
< < | Commands | |||||||
> > |
Terminology
Working Notes
| |||||||
GET CHANGES | ||||||||
Line: 112 to 177 | ||||||||
-- LaurieNevay - 25 Sep 2014 \ No newline at end of file | ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Git GuideCreated by Linus, it's a great versioning system for software. Especially useful when you have lots of people developing simultaneously on lots of different versions of software. Used from large projects such as the linux kernel down to a paper written in latex between a few people.ObtainingYou can get Git easily using Macports. Search for itport search git .
UsingTypically command line. A great free GUI is SourceTree![]() ![]() ![]() CommandsGET CHANGES git pull SEND CHANGES git push PUSH PULL - WHICH ORDER you’ve committed things locally and want to push them - push fails as the server has changed (“your branch is behind the tip”). To avoid this, do your commits, then PULL, then PUSH. COMMIT the saves the changes git commit -a -m”your message” -a means stage all changed files (careful!) -m the commit message for that change CHECKOUT changes your current view / branch you’re on. changes the contents of the folder - only do from the root of the repository - ie not in a subfolder. git checkout branchname ie git checkout develop master is always the default branch in any repository and develop is the most common one to work in, so usually when you get a repository, you need to checkout the develop branch VIEW ALL BRANCHES git branch -a CREATE A BRANCH How to create a branch. Merge is into what you're working locally on. Use checkout to change 'focus' of what you're on now. git fetch origin #get status update from server git checkout branchA git merge master uh oh - resolve conflicts here git checkout master git merge branchA git pus origin CREATE A BRANCH USING CURRENT CHANGES So you’ve worked in develop and changed things and want to move the current changes into a branch: git checkout -b newbranchname maybe have to do a commit now MERGING / RESOLVING CONFLICTS setup merge tool to meld sudo port install meld git config --global merge.tool meld launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist DELETE A BRANCH - make sure you're not in a branch - by checking something else git branch -D branchname DELETE A REMOTE BRANCH git push origin —delete branchname WHEN IN YOUR BRANCH git merge sourcebranchname do this often while in my feature branch to pull in the changes into my branch from sourcebranchname RESET STUFF git reset HEAD --hard git clean -fd SUBMODULES INIT git clone —recursive initialise submodules too SUBMODULE UPDATE git submodule update-- LaurieNevay - 25 Sep 2014 |