| |   |
| 0 | | class Project < ActiveRecord::Base |
| 1 | | acts_as_taggable |
| 2 | | |
| 3 | | belongs_to :user |
| 4 | | has_many :comments, :dependent => :destroy |
| 5 | | has_many :repositories, :order => "repositories.mainline desc, repositories.created_at asc", |
| 6 | | :dependent => :destroy |
| 7 | | has_one :mainline_repository, :conditions => ["mainline = ?", true], |
| 8 | | :class_name => "Repository" |
| 9 | | has_many :repository_clones, :conditions => ["mainline = ?", false], |
| 10 | | :class_name => "Repository" |
| 11 | | |
| 12 | | # Appcast membership system |
| 13 | | if $application_mode == MODE_APPCAST then |
| 14 | | belongs_to :wiki |
| 15 | | has_many :members, :dependent => :destroy |
| 16 | | has_many :users, :through => :members |
| 17 | | has_many :articles |
| 18 | | end |
| 19 | | |
| 20 | | |
| 21 | | is_indexed :fields => ["title", "description", "slug"], |
| 22 | | :concatenate => [ |
| 23 | | { :class_name => 'Tag', |
| 24 | | :field => 'name', |
| 25 | | :as => 'category', |
| 26 | | :association_sql => "LEFT OUTER JOIN taggings ON taggings.taggable_id = projects.id " + |
| 27 | | "AND taggings.taggable_type = 'Project' LEFT OUTER JOIN tags ON taggings.tag_id = tags.id" |
| 28 | | }], |
| 29 | | :include => [{ |
| 30 | | :association_name => "user", |
| 31 | | :field => "login", |
| 32 | | :as => "user" |
| 33 | | }] |
| 34 | | |
| 35 | | |
| 36 | | URL_FORMAT_RE = /^(http|https|nntp):\/\//.freeze |
| 37 | | validates_presence_of :title, :user_id, :slug |
| 38 | | validates_uniqueness_of :slug, :case_sensitive => false |
| 39 | | validates_format_of :slug, :with => /^[a-z0-9_\-]+$/i, |
| 40 | | :message => "must match something in the range of [a-z0-9_\-]+" |
| 41 | | validates_format_of :home_url, :with => URL_FORMAT_RE, |
| 42 | | :if => proc{|record| !record.home_url.blank? }, |
| 43 | | :message => "Must begin with http(s)" |
| 44 | | validates_format_of :mailinglist_url, :with => URL_FORMAT_RE, |
| 45 | | :if => proc{|record| !record.mailinglist_url.blank? }, |
| 46 | | :message => "Must begin with http(s)" |
| 47 | | validates_format_of :bugtracker_url, :with => URL_FORMAT_RE, |
| 48 | | :if => proc{|record| !record.bugtracker_url.blank? }, |
| 49 | | :message => "Must begin with http(s)" |
| 50 | | |
| 51 | | before_validation :downcase_slug |
| 52 | | after_create :create_mainline_repository |
| 53 | | |
| 54 | | LICENSES = [ |
| 55 | | 'MIT License', |
| 56 | | 'BSD License', |
| 57 | | 'Ruby License', |
| 58 | | 'GNU General Public License version 2(GPLv2)', |
| 59 | | 'GNU General Public License version 3 (GPLv3)', |
| 60 | | <<<<<<< HEAD:app/models/project.rb |
| 61 | | 'GNU Library Public License (LGPL)', |
| 62 | | ======= |
| 63 | | 'GNU Lesser General Public License (LGPL)', |
| 64 | | 'GNU Affero General Public License (AGPLv3)', |
| 65 | | >>>>>>> d2dea3016197479bf4c039126ea7dfc7304a6fb2:app/models/project.rb |
| 66 | | 'Mozilla Public License 1.0 (MPL)', |
| 67 | | 'Mozilla Public License 1.1 (MPL 1.1)', |
| 68 | | 'Qt Public License (QPL)', |
| 69 | | 'Python License', |
| 70 | | 'zlib/libpng License', |
| 71 | | 'Apache Software License', |
| 72 | | 'Apple Public Source License', |
| 73 | | 'Perl Artistic License', |
| 74 | | 'Microsoft Permissive License (Ms-PL)', |
| 75 | | 'ISC License', |
| 76 | | 'Lisp Lesser License', |
| 77 | | 'Public Domain', |
| 78 | | 'Other Open Source Initiative Approved License', |
| 79 | | 'Other/Proprietary License', |
| 80 | | 'None', |
| 81 | | ] |
| 82 | | |
| 83 | | def self.find_by_slug!(slug) |
| 84 | | find_by_slug(slug) || raise(ActiveRecord::RecordNotFound) |
| 85 | | end |
| 86 | | |
| 87 | | def self.per_page() 20 end |
| 88 | | |
| 89 | | def self.top_tags(limit = 10) |
| 90 | | tag_counts(:limit => limit, :order => "count desc") |
| 91 | | end |
| 92 | | |
| 93 | | def to_param |
| 94 | | slug |
| 95 | | end |
| 96 | | |
| 97 | | def admin?(candidate) |
| 98 | | candidate == user |
| 99 | | end |
| 100 | | |
| 101 | | def can_be_deleted_by?(candidate) |
| 102 | | (candidate == user) && (repositories.size == 1) |
| 103 | | end |
| 104 | | |
| 105 | | def tag_list=(tag_list) |
| 106 | | tag_list.gsub!(",", "") |
| 107 | | |
| 108 | | super |
| 109 | | end |
| 110 | | |
| 111 | | def stripped_description |
| 112 | | description.gsub(/<\/?[^>]*>/, "") |
| 113 | | # sanitizer = HTML::WhiteListSanitizer.new |
| 114 | | # sanitizer.sanitize(description, :tags => %w(str), :attributes => %w(class)) |
| 115 | | end |
| 116 | | |
| 117 | | def to_xml(opts = {}) |
| 118 | | info = Proc.new { |options| |
| 119 | | builder = options[:builder] |
| 120 | | builder.owner user.login |
| 121 | | |
| 122 | | builder.repositories :type => "array" do |
| 123 | | repositories.each { |repo| |
| 124 | | builder.repository do |
| 125 | | builder.id repo.id |
| 126 | | builder.name repo.name |
| 127 | | builder.owner repo.user.login |
| 128 | | end |
| 129 | | } |
| 130 | | end |
| 131 | | } |
| 132 | | super({:procs => [info]}.merge(opts)) |
| 133 | | end |
| 134 | | |
| 135 | | protected |
| 136 | | def create_mainline_repository |
| 137 | | self.repositories.create!(:user => self.user, :name => "mainline") |
| 138 | | end |
| 139 | | |
| 140 | | def downcase_slug |
| 141 | | slug.downcase! if slug |
| 142 | | end |
| 143 | | |
| 144 | | |
| 145 | | # |
| 146 | | # Appcast specific |
| 147 | | # |
| 148 | | |
| 149 | | #public version of .count to filter projects you are not authorised to see |
| 150 | | def self.public_count (user, curruser) |
| 151 | | visible_projects = find_by_user(user, curruser) |
| 152 | | return visible_projects.size |
| 153 | | end |
| 154 | | |
| 155 | | # |
| 156 | | def self.allowed_access (project_id, curruser) |
| 157 | | projects_allowed = Project.list_for_user(curruser) |
| 158 | | p = find(:first, :conditions => ["status = '#{:active}' AND projects.id = '" << project_id.to_s << "' AND ( audience = '#{:public}' OR projects.id IN (" << projects_allowed << ") )"]) |
| 159 | | if p != nil then |
| 160 | | return true |
| 161 | | else |
| 162 | | return false |
| 163 | | end |
| 164 | | end |
| 165 | | |
| 166 | | # |
| 167 | | #FIXME this should maybe show inactive too |
| 168 | | def self.find_by_user(user, curruser) |
| 169 | | projects_allowed = Project.list_for_user(curruser) |
| 170 | | projects_available = Project.list_for_user(user) |
| 171 | | find(:all, :conditions => ["status = '#{:active}' AND projects.id IN (" << projects_available << ") AND ( audience = '#{:public}' OR projects.id IN (" << projects_allowed << ") )"]) |
| 172 | | end |
| 173 | | |
| 174 | | # returns all allowed projects |
| 175 | | def self.find_all_projects (curruser) |
| 176 | | projects_allowed = Project.list_for_user(curruser) |
| 177 | | find(:all, :conditions => ["status = '#{:active}' AND ( audience = '#{:public}' OR id IN (" << projects_allowed << ") )"]) |
| 178 | | end |
| 179 | | |
| 180 | | # returns all public projects (no private regardless of allowed) |
| 181 | | def self.find_all_active_public_projects (curruser) |
| 182 | | projects_allowed = Project.list_for_user(curruser) |
| 183 | | find(:all, :conditions => ["status = '#{:active}' AND ( audience = '#{:public}' AND NOT id IN (" << projects_allowed << ") )"]) |
| 184 | | end |
| 185 | | |
| 186 | | # returns only allowed, no public |
| 187 | | def self.find_all_active_member_projects(curruser) |
| 188 | | find(:all, |
| 189 | | :joins => "INNER JOIN members ON projects.id = members.project_id AND members.user_id = '#{curruser.id}'", |
| 190 | | :conditions => ["status = '#{:active}'"] |
| 191 | | ) |
| 192 | | end |
| 193 | | |
| 194 | | # |
| 195 | | def self.find_by_slug_secure(slug, curruser) |
| 196 | | projects_allowed = Project.list_for_user(curruser) |
| 197 | | find(:first, :conditions => ["status = '#{:active}' AND slug = '#{slug}' AND ( audience = '#{:public}' OR projects.id IN (" << projects_allowed << ") )"]) |
| 198 | | end |
| 199 | | |
| 200 | | # takes a list of project_ids e.g. '1','2','3' |
| 201 | | def self.find_by_list (list, curruser) |
| 202 | | projects_allowed = Project.list_for_user(curruser) |
| 203 | | find(:all, :conditions => ["status = '#{:active}' AND id IN (" << list << ") AND ( audience = '#{:public}' AND id IN (" << projects_allowed << ") )"]) |
| 204 | | end |
| 205 | | |
| 206 | | # |
| 207 | | # Get a list of project_ids of a user is a members of in the format '1','2','3' |
| 208 | | # FIXME this should be in a helper I think |
| 209 | | # |
| 210 | | def self.list_for_user(user) |
| 211 | | #if user != nil then |
| 212 | | # list = "" |
| 213 | | # projects = Member.find_by_user(user.id) |
| 214 | | # if projects.size > 0 then |
| 215 | | # start = true |
| 216 | | # for project in projects |
| 217 | | # if not start then |
| 218 | | # list = list << "," |
| 219 | | # else |
| 220 | | # start = false |
| 221 | | # end |
| 222 | | # list = list << "'" << project.project_id.to_s << "'" |
| 223 | | # end |
| 224 | | # return list |
| 225 | | # else |
| 226 | | # return "'1'" # see below |
| 227 | | # end |
| 228 | | #else |
| 229 | | return "'1'" # Project.id 1 is no project (this is a bit of a frig really, without it 2 queries will be needed for all finds) |
| 230 | | #end |
| 231 | | end |
| 232 | | |
| 233 | | def self.tab_settings (tab) |
| 234 | | case tab |
| 235 | | when PRJ_TAB_SUMMARY |
| 236 | | title = "Summary" |
| 237 | | url_suffix = "" |
| 238 | | when PRJ_TAB_DOWNLOADS |
| 239 | | title = "Downloads" |
| 240 | | url_suffix = "/downloads" |
| 241 | | when PRJ_TAB_REPOS |
| 242 | | title = "Repos" |
| 243 | | url_suffix = "/repos" |
| 244 | | when PRJ_TAB_ROADMAP |
| 245 | | title = "Roadmap" |
| 246 | | url_suffix = "/roadmap" |
| 247 | | when PRJ_TAB_TICKETS |
| 248 | | title = "Tickets" |
| 249 | | url_suffix = "/tickets" |
| 250 | | when PRJ_TAB_ARTICLES |
| 251 | | title = "Articles" |
| 252 | | url_suffix = "/articles" |
| 253 | | when PRJ_TAB_FORUM |
| 254 | | title = "Forum" |
| 255 | | url_suffix = "/forum" |
| 256 | | when PRJ_TAB_WIKI |
| 257 | | title = "Wiki" |
| 258 | | url_suffix = "/wikis" |
| 259 | | when PRJ_TAB_TIMELINE |
| 260 | | title = "Timeline" |
| 261 | | url_suffix = "/timeline" |
| 262 | | when PRJ_TAB_CONFIG |
| 263 | | title = "Config" |
| 264 | | url_suffix = "/config" |
| 265 | | end |
| 266 | | return title, url_suffix |
| 267 | | end |
| 268 | | |
| 269 | | |
| 270 | | |
| 271 | | end |
| toggle raw diff |
--- a/app/models/project.rb.orig
+++ /dev/null
@@ -1,272 +0,0 @@
-class Project < ActiveRecord::Base
- acts_as_taggable
-
- belongs_to :user
- has_many :comments, :dependent => :destroy
- has_many :repositories, :order => "repositories.mainline desc, repositories.created_at asc",
- :dependent => :destroy
- has_one :mainline_repository, :conditions => ["mainline = ?", true],
- :class_name => "Repository"
- has_many :repository_clones, :conditions => ["mainline = ?", false],
- :class_name => "Repository"
-
- # Appcast membership system
- if $application_mode == MODE_APPCAST then
- belongs_to :wiki
- has_many :members, :dependent => :destroy
- has_many :users, :through => :members
- has_many :articles
- end
-
-
- is_indexed :fields => ["title", "description", "slug"],
- :concatenate => [
- { :class_name => 'Tag',
- :field => 'name',
- :as => 'category',
- :association_sql => "LEFT OUTER JOIN taggings ON taggings.taggable_id = projects.id " +
- "AND taggings.taggable_type = 'Project' LEFT OUTER JOIN tags ON taggings.tag_id = tags.id"
- }],
- :include => [{
- :association_name => "user",
- :field => "login",
- :as => "user"
- }]
-
-
- URL_FORMAT_RE = /^(http|https|nntp):\/\//.freeze
- validates_presence_of :title, :user_id, :slug
- validates_uniqueness_of :slug, :case_sensitive => false
- validates_format_of :slug, :with => /^[a-z0-9_\-]+$/i,
- :message => "must match something in the range of [a-z0-9_\-]+"
- validates_format_of :home_url, :with => URL_FORMAT_RE,
- :if => proc{|record| !record.home_url.blank? },
- :message => "Must begin with http(s)"
- validates_format_of :mailinglist_url, :with => URL_FORMAT_RE,
- :if => proc{|record| !record.mailinglist_url.blank? },
- :message => "Must begin with http(s)"
- validates_format_of :bugtracker_url, :with => URL_FORMAT_RE,
- :if => proc{|record| !record.bugtracker_url.blank? },
- :message => "Must begin with http(s)"
-
- before_validation :downcase_slug
- after_create :create_mainline_repository
-
- LICENSES = [
- 'MIT License',
- 'BSD License',
- 'Ruby License',
- 'GNU General Public License version 2(GPLv2)',
- 'GNU General Public License version 3 (GPLv3)',
-<<<<<<< HEAD:app/models/project.rb
- 'GNU Library Public License (LGPL)',
-=======
- 'GNU Lesser General Public License (LGPL)',
- 'GNU Affero General Public License (AGPLv3)',
->>>>>>> d2dea3016197479bf4c039126ea7dfc7304a6fb2:app/models/project.rb
- 'Mozilla Public License 1.0 (MPL)',
- 'Mozilla Public License 1.1 (MPL 1.1)',
- 'Qt Public License (QPL)',
- 'Python License',
- 'zlib/libpng License',
- 'Apache Software License',
- 'Apple Public Source License',
- 'Perl Artistic License',
- 'Microsoft Permissive License (Ms-PL)',
- 'ISC License',
- 'Lisp Lesser License',
- 'Public Domain',
- 'Other Open Source Initiative Approved License',
- 'Other/Proprietary License',
- 'None',
- ]
-
- def self.find_by_slug!(slug)
- find_by_slug(slug) || raise(ActiveRecord::RecordNotFound)
- end
-
- def self.per_page() 20 end
-
- def self.top_tags(limit = 10)
- tag_counts(:limit => limit, :order => "count desc")
- end
-
- def to_param
- slug
- end
-
- def admin?(candidate)
- candidate == user
- end
-
- def can_be_deleted_by?(candidate)
- (candidate == user) && (repositories.size == 1)
- end
-
- def tag_list=(tag_list)
- tag_list.gsub!(",", "")
-
- super
- end
-
- def stripped_description
- description.gsub(/<\/?[^>]*>/, "")
- # sanitizer = HTML::WhiteListSanitizer.new
- # sanitizer.sanitize(description, :tags => %w(str), :attributes => %w(class))
- end
-
- def to_xml(opts = {})
- info = Proc.new { |options|
- builder = options[:builder]
- builder.owner user.login
-
- builder.repositories :type => "array" do
- repositories.each { |repo|
- builder.repository do
- builder.id repo.id
- builder.name repo.name
- builder.owner repo.user.login
- end
- }
- end
- }
- super({:procs => [info]}.merge(opts))
- end
-
- protected
- def create_mainline_repository
- self.repositories.create!(:user => self.user, :name => "mainline")
- end
-
- def downcase_slug
- slug.downcase! if slug
- end
-
-
- #
- # Appcast specific
- #
-
- #public version of .count to filter projects you are not authorised to see
- def self.public_count (user, curruser)
- visible_projects = find_by_user(user, curruser)
- return visible_projects.size
- end
-
- #
- def self.allowed_access (project_id, curruser)
- projects_allowed = Project.list_for_user(curruser)
- p = find(:first, :conditions => ["status = '#{:active}' AND projects.id = '" << project_id.to_s << "' AND ( audience = '#{:public}' OR projects.id IN (" << projects_allowed << ") )"])
- if p != nil then
- return true
- else
- return false
- end
- end
-
- #
- #FIXME this should maybe show inactive too
- def self.find_by_user(user, curruser)
- projects_allowed = Project.list_for_user(curruser)
- projects_available = Project.list_for_user(user)
- find(:all, :conditions => ["status = '#{:active}' AND projects.id IN (" << projects_available << ") AND ( audience = '#{:public}' OR projects.id IN (" << projects_allowed << ") )"])
- end
-
- # returns all allowed projects
- def self.find_all_projects (curruser)
- projects_allowed = Project.list_for_user(curruser)
- find(:all, :conditions => ["status = '#{:active}' AND ( audience = '#{:public}' OR id IN (" << projects_allowed << ") )"])
- end
-
- # returns all public projects (no private regardless of allowed)
- def self.find_all_active_public_projects (curruser)
- projects_allowed = Project.list_for_user(curruser)
- find(:all, :conditions => ["status = '#{:active}' AND ( audience = '#{:public}' AND NOT id IN (" << projects_allowed << ") )"])
- end
-
- # returns only allowed, no public
- def self.find_all_active_member_projects(curruser)
- find(:all,
- :joins => "INNER JOIN members ON projects.id = members.project_id AND members.user_id = '#{curruser.id}'",
- :conditions => ["status = '#{:active}'"]
- )
- end
-
- #
- def self.find_by_slug_secure(slug, curruser)
- projects_allowed = Project.list_for_user(curruser)
- find(:first, :conditions => ["status = '#{:active}' AND slug = '#{slug}' AND ( audience = '#{:public}' OR projects.id IN (" << projects_allowed << ") )"])
- end
-
- # takes a list of project_ids e.g. '1','2','3'
- def self.find_by_list (list, curruser)
- projects_allowed = Project.list_for_user(curruser)
- find(:all, :conditions => ["status = '#{:active}' AND id IN (" << list << ") AND ( audience = '#{:public}' AND id IN (" << projects_allowed << ") )"])
- end
-
- #
- # Get a list of project_ids of a user is a members of in the format '1','2','3'
- # FIXME this should be in a helper I think
- #
- def self.list_for_user(user)
- #if user != nil then
- # list = ""
- # projects = Member.find_by_user(user.id)
- # if projects.size > 0 then
- # start = true
- # for project in projects
- # if not start then
- # list = list << ","
- # else
- # start = false
- # end
- # list = list << "'" << project.project_id.to_s << "'"
- # end
- # return list
- # else
- # return "'1'" # see below
- # end
- #else
- return "'1'" # Project.id 1 is no project (this is a bit of a frig really, without it 2 queries will be needed for all finds)
- #end
- end
-
- def self.tab_settings (tab)
- case tab
- when PRJ_TAB_SUMMARY
- title = "Summary"
- url_suffix = ""
- when PRJ_TAB_DOWNLOADS
- title = "Downloads"
- url_suffix = "/downloads"
- when PRJ_TAB_REPOS
- title = "Repos"
- url_suffix = "/repos"
- when PRJ_TAB_ROADMAP
- title = "Roadmap"
- url_suffix = "/roadmap"
- when PRJ_TAB_TICKETS
- title = "Tickets"
- url_suffix = "/tickets"
- when PRJ_TAB_ARTICLES
- title = "Articles"
- url_suffix = "/articles"
- when PRJ_TAB_FORUM
- title = "Forum"
- url_suffix = "/forum"
- when PRJ_TAB_WIKI
- title = "Wiki"
- url_suffix = "/wikis"
- when PRJ_TAB_TIMELINE
- title = "Timeline"
- url_suffix = "/timeline"
- when PRJ_TAB_CONFIG
- title = "Config"
- url_suffix = "/config"
- end
- return title, url_suffix
- end
-
-
-
-end |
| |   |
| 1 | 1 | GIT |
| 2 | 2 | |
| 3 | | http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way |
| 4 | 3 | |
| 5 | | Under Ubuntu had to also add git to a new sshusers group to sshusers to AllowGroups in /etc/ssh/sshd_config, used webmin to add the user to groups and to restart ssh |
| 6 | 4 | |
| 7 | 5 | Also note everything is case sensitive |
| 8 | 6 | |
| 7 | ### Useful Resources: |
| 9 | 8 | |
| 9 | (http://www.kernel.org/pub/software/scm/git/docs/user-manual.html) |
| 10 | (http://www.sourcemage.org/Git_Guide) |
| 11 | (http://wiki.sourcemage.org/Git_Guide) |
| 12 | (http://blog.neontology.com/posts/2007/10/17/git) |
| 13 | (http://tomayko.com/writings/the-thing-about-git) |
| 10 | 14 | |
| 15 | ### Installing |
| 11 | 16 | |
| 12 | | Full GIT user manual: |
| 13 | | |
| 14 | | http://www.kernel.org/pub/software/scm/git/docs/user-manual.html |
| 15 | | http://www.sourcemage.org/Git_Guide |
| 16 | | http://wiki.sourcemage.org/Git_Guide |
| 17 | | http://blog.neontology.com/posts/2007/10/17/git |
| 18 | | http://tomayko.com/writings/the-thing-about-git |
| 19 | | |
| 20 | | Change default Linux editor in ~/.bashrc: |
| 21 | | |
| 17 | <pre> |
| 18 | # Change default Linux editor in ~/.bashrc: |
| 22 | 19 | EDITOR=nano export EDITOR |
| 20 | </pre> |
| 23 | 21 | |
| 24 | | |
| 25 | | |
| 26 | | Create a .gitconfig in ~ |
| 22 | <pre> |
| 23 | # Create a .gitconfig in ~ |
| 27 | 24 | |
| 28 | 25 | [user] |
| 29 | 26 | name = Your Name Comes Here |
| 30 | 27 | email = you@yourdomain.example.com |
| 28 | </pre> |
| 31 | 29 | |
| 32 | | |
| 33 | | |
| 34 | | Create an ignore file (.gitignore) if not already in your project root |
| 30 | <pre> |
| 31 | # Create an ignore file (.gitignore) if not already in your project root |
| 35 | 32 | |
| 36 | 33 | # Ignore any file named foo.txt. |
| 37 | 34 | foo.txt |
| … | … | |
| 40 | 40 | *.[oa] |
| 41 | 41 | # Ignore directories |
| 42 | 42 | log/* |
| 43 | | nbproject/* |
| 43 | </pre> |
| 44 | 44 | |
| 45 | ### Installing a remote repository |
| 45 | 46 | |
| 46 | | To commit changes to local repo: |
| 47 | http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way |
| 48 | Under Ubuntu had to also add git to a new sshusers group to sshusers to AllowGroups in /etc/ssh/sshd_config, used webmin to add the user to groups and to restart ssh |
| 47 | 49 | |
| 48 | | git commit -a |
| 49 | 50 | |
| 51 | ### Useful commands |
| 50 | 52 | |
| 51 | | To add a new file to local repo: |
| 53 | <pre> |
| 54 | # To commit changes to local repo: |
| 55 | git commit -a |
| 56 | </pre> |
| 52 | 57 | |
| 58 | <pre> |
| 59 | # To add a new file to local repo: |
| 53 | 60 | git add <filename> |
| 54 | 61 | |
| 62 | # To add all new files to the local repo: |
| 63 | git add . |
| 64 | </pre> |
| 65 | |
| 55 | 66 | |
| 56 | 67 | To see the changes: |
| 57 | 68 | |
| toggle raw diff |
--- a/test/fixtures/wiki_pages/_git_crib_sheet.txt
+++ b/test/fixtures/wiki_pages/_git_crib_sheet.txt
@@ -1,37 +1,34 @@
GIT
-http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
-Under Ubuntu had to also add git to a new sshusers group to sshusers to AllowGroups in /etc/ssh/sshd_config, used webmin to add the user to groups and to restart ssh
Also note everything is case sensitive
+### Useful Resources:
+(http://www.kernel.org/pub/software/scm/git/docs/user-manual.html)
+(http://www.sourcemage.org/Git_Guide)
+(http://wiki.sourcemage.org/Git_Guide)
+(http://blog.neontology.com/posts/2007/10/17/git)
+(http://tomayko.com/writings/the-thing-about-git)
+### Installing
-Full GIT user manual:
-
-http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
-http://www.sourcemage.org/Git_Guide
-http://wiki.sourcemage.org/Git_Guide
-http://blog.neontology.com/posts/2007/10/17/git
-http://tomayko.com/writings/the-thing-about-git
-
-Change default Linux editor in ~/.bashrc:
-
+<pre>
+# Change default Linux editor in ~/.bashrc:
EDITOR=nano export EDITOR
+</pre>
-
-
-Create a .gitconfig in ~
+<pre>
+# Create a .gitconfig in ~
[user]
name = Your Name Comes Here
email = you@yourdomain.example.com
+</pre>
-
-
-Create an ignore file (.gitignore) if not already in your project root
+<pre>
+# Create an ignore file (.gitignore) if not already in your project root
# Ignore any file named foo.txt.
foo.txt
@@ -43,18 +40,29 @@ foo.txt
*.[oa]
# Ignore directories
log/*
-nbproject/*
+</pre>
+### Installing a remote repository
-To commit changes to local repo:
+http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
+Under Ubuntu had to also add git to a new sshusers group to sshusers to AllowGroups in /etc/ssh/sshd_config, used webmin to add the user to groups and to restart ssh
-git commit -a
+### Useful commands
-To add a new file to local repo:
+<pre>
+# To commit changes to local repo:
+git commit -a
+</pre>
+<pre>
+# To add a new file to local repo:
git add <filename>
+# To add all new files to the local repo:
+git add .
+</pre>
+
To see the changes:
|