Changes between Version 11 and Version 12 of Csle2022/Agenda/scriptingandgithub


Ignore:
Timestamp:
Nov 1, 2022, 2:49:25 PM (2 years ago)
Author:
deepthi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/scriptingandgithub

    v11 v12  
    212212
    213213=== Install Git and create a Github account ===
     214
     215To see if you already have Git installed, open up your terminal application.
     216
     217Once you've opened your terminal application, type git version. The output will either tell you which version of Git is installed, or it will alert you that git is an unknown command. If it's an unknown command, read further and find out how to install Git.
     218
     219Install git:
     220
     221Debian/Ubuntu
     222
     223Git packages are available using `apt`.
     224
     225It's a good idea to make sure you're running the latest version. To do so, Navigate to your command prompt shell and run the following command to make sure everything is up-to-date: `sudo apt-get update`.
     226
     227To install Git, run the following command: `sudo apt-get install git-all`.
     228
     229Once the command output has completed, you can verify the installation by typing: `git version`.
     230
     231To create the github account:
     232
     233Navigate [https://github.com] and signup with your details
     234
    214235=== Install source tree on your computer ===
    215 === Create a local Git repo(Cloning) ===
     236
     237=== Create a local Git repo ===
     238
     239===== Every git repository has three trees. A working directory, Index and Head. ====
     240
     241- Working directory: It contains the actual project files.
     242
     243- Index: It is the staging area where you add the project files that needs to be committed.
     244
     245- Head: Head is where the reference to you previous commit exists.
     246
     247git init is one way to start a new project with Git. To start a repository, use either `git init` or `git clone` - not both.
     248
     249 To initialize a repository, Git creates a hidden directory called `.git`. That directory stores all of the objects and refs that Git uses and creates as a part of the project's history. This hidden `.git` directory is what separates a regular directory from a Git repository.
     250
     251{{{
     252git init: One Person Starting a New Repository Locally
     253git clone: The Remote Already Exists
     254}}}
     255
    216256=== Add a new file to the repo ===
    217257=== Add a file to the staging environment ===
     258
    218259=== Create a commit ===
    219260=== Create a branch ===
     
    224265===  Get changes on your Github back your computer ===
    225266
    226 
    227 
    228 
    229 
    230 
    231 Creating a repository
    232 
    233 Create a project directory and cd into it. Execute the following git command from the directory to create a git repository.
    234 
    235 `git init`
     267==== Committing new changes to the repository (commit): ====
     268
     269Once you have added all the files to the staging area, you can commit the changes with a reference message using the “-m” flag as shown below.
     270
     271git commit -m “my first commit”
     272
     273
     274
     275
     276
    236277
    237278==== Checking out a repository ====
     
    241282`git clone /path/to/project-repository`
    242283
    243 ===== Every git repository has three trees. A working directory, Index and Head. ====
    244 
    245 - Working directory: It contains the actual project files.
    246 
    247 - Index: It is the staging area where you add the project files that needs to be committed.
    248 
    249 - Head: Head is where the reference to you previous commit exists.
     284
    250285
    251286==== Adding file to the staging area: (add) ====
     
    257292`git add --all`
    258293
    259 ==== Committing new changes to the repository (commit): ====
    260 
    261 Once you have added all the files to the staging area, you can commit the changes with a reference message using the “-m” flag as shown below.
    262 
    263 git commit -m “my first commit”
    264 
    265 
    266 
    267 
    268 
     294
     295
     296
     297
     298
     299