Version 1 (modified by 2 years ago) ( diff ) | ,
---|
Github administration
Install Git and create a Github account
To see if you already have Git installed, open up your terminal application.
Once 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.
Install git:
Git packages are available using apt
.
It'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
.
To install Git, run the following command: sudo apt-get install git-all
.
Once the command output has completed, you can verify the installation by typing: git version
.
To create the github account:
Navigate https://github.com and signup with your details
Install source tree on your computer
Create a local Git repo
Every git repository has three trees. A working directory, Index and Head. ====
- Working directory: It contains the actual project files.
- Index: It is the staging area where you add the project files that needs to be committed.
- Head: Head is where the reference to you previous commit exists.
git init is one way to start a new project with Git. To start a repository, use either git init
or git clone
- not both.
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.
git init: One Person Starting a New Repository Locally git clone: The Remote Already Exists
Add a new file to the repo
Add a file to the staging environment
Create a commit
Create a branch
Create a new repo on Github
Push a branch to GitHub
Create a pull request
Merge a pull request
Get changes on your Github back your computer
Committing new changes to the repository (commit):
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.
git commit -m “my first commit”
Checking out a repository
You can create a copy of your git repository using the clone command. Execute the following command to clone your project directory.
git clone /path/to/project-repository
Adding file to the staging area: (add)
git add <filename>
Let’s say you want to add all the files in your project directory to the staging area. Execute the following command to do the same
git add --all
Attachments (18)
- upload-files-button.png (25.7 KB ) - added by 2 years ago.
- upload-files-drag-and-drop.png (9.9 KB ) - added by 2 years ago.
- write-commit-message-quick-pull.png (9.2 KB ) - added by 2 years ago.
- choose-commit-branch.png (31.4 KB ) - added by 2 years ago.
- commit-changes-button.png (19.3 KB ) - added by 2 years ago.
- branches-overview-link-2.png (105.3 KB ) - added by 2 years ago.
- new-branch-button.png (103.7 KB ) - added by 2 years ago.
- branch-creation-popup-branch-source.png (29.7 KB ) - added by 2 years ago.
- branch-creation-popup-button.png (66.6 KB ) - added by 2 years ago.
- branches-overview-link-3.png (105.3 KB ) - added by 2 years ago.
- branch-selection-dropdown.png (6.1 KB ) - added by 2 years ago.
- branch-creation-text-box.png (26.0 KB ) - added by 2 years ago.
- branch-dropdown.png (29.1 KB ) - added by 2 years ago.
- branch-dropdown-2.png (29.1 KB ) - added by 2 years ago.
- pull-request-start-review-button.png (25.9 KB ) - added by 2 years ago.
- choose-base-and-compare-branches.png (34.1 KB ) - added by 2 years ago.
- pullrequest-description.png (28.2 KB ) - added by 2 years ago.
- pullrequest-send.png (25.6 KB ) - added by 2 years ago.
Download all attachments as: .zip