Used terms in Github

  • Repository: Repository is basically a project folder which contains all the related information and the codes related to the project.

  • Remote: Remote is used for referring to any repository which is hosted on github.

  • Branch: Master branch is the stable piece of code which you can show to the client. While you try to make a change to the branch, you don’t change the main branch, but the copy of it. When the change is run successfully, you merge the copy of the branch again to the master branch. The master branch is the version that always works.

  • Commit: Committing means you are keeping a track of all the changes that you do in a github repository. Suppose you add a feature in your model, you “commit: it to the GitHub repository

  • Head: The topmost commit to any branch is called head.

  • Push: The transfer of code from the local git to the remote git is called push.

  • Fork: Fork means you are making a copy of the repository in your own github profile. The difference between cloning and fork is that while cloning is done in the local system, the fork is done in a Github profile.

  • Pull: Transfer the changes done in the remote repository to the local git is called pull.

  • Clone: You use cloning when you want to duplicate the repository.

  • https://training.github.com/downloads/github-git-cheat-sheet.pdf

Git Installation

Windows:

Go to https://git-scm.com/download/win/ link and download git. Once installed, you’ll be able to use Git from the command prompt or PowerShell.

Macos

$ Brew install git

Linux:

$ sudo apt-get install git


Configuration

$ git config --global user.name “rkmishracs”

$ git config --global user.email “email@gmail.com”

Step by step Github using: Got to particular directory write below commands : ( I am using windows)

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git init

Initialized empty Git repository in C:/Users/rkmishra/source/repos/mysqldjnago/.git/

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git status

On branch master

No commits yet

Untracked files:

(use "git add <file>..." to include in what will be committed)

.vs/

app/

db.sqlite3

env/

manage.py

mysqldjnago.pyproj

mysqldjnago.pyproj.user

mysqldjnago.sln

mysqldjnago/

readme.html

requirements.txt

nothing added to commit but untracked files present (use "git add" to track)

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git add .\app\ .\mysqldjnago\ .\manage.py .\readme.html

On branch master


No commits yet


Changes to be committed:

(use "git rm --cached <file>..." to unstage)

new file: app/__init__.py

new file: app/__pycache__/__init__.cpython-39.pyc

new file: app/__pycache__/forms.cpython-39.pyc

new file: app/__pycache__/models.cpython-39.pyc

new file: app/__pycache__/views.cpython-39.pyc

new file: app/forms.py

new file: app/migrations/__init__.py

new file: app/migrations/__pycache__/__init__.cpython-39.pyc

new file: app/models.py

new file: app/static/app/content/bootstrap.css

new file: app/static/app/content/bootstrap.min.css

new file: app/static/app/content/site.css

new file: app/static/app/fonts/glyphicons-halflings-regular.eot

new file: app/static/app/fonts/glyphicons-halflings-regular.svg

new file: app/static/app/fonts/glyphicons-halflings-regular.ttf

new file: app/static/app/fonts/glyphicons-halflings-regular.woff

new file: app/static/app/scripts/_references.js

new file: app/static/app/scripts/bootstrap.js

new file: app/static/app/scripts/bootstrap.min.js

new file: app/static/app/scripts/jquery-1.10.2.intellisense.js

new file: app/static/app/scripts/jquery-1.10.2.js

new file: app/static/app/scripts/jquery-1.10.2.min.js

new file: app/static/app/scripts/jquery-1.10.2.min.map

new file: app/static/app/scripts/jquery.validate-vsdoc.js

new file: app/static/app/scripts/jquery.validate.js

new file: app/static/app/scripts/jquery.validate.min.js

new file: app/static/app/scripts/jquery.validate.unobtrusive.js

new file: app/static/app/scripts/jquery.validate.unobtrusive.min.js

new file: app/static/app/scripts/modernizr-2.6.2.js

new file: app/static/app/scripts/respond.js

new file: app/static/app/scripts/respond.min.js

new file: app/templates/app/about.html

new file: app/templates/app/contact.html

new file: app/templates/app/index.html

new file: app/templates/app/layout.html

new file: app/templates/app/login.html

new file: app/templates/app/loginpartial.html

new file: app/tests.py

new file: app/views.py

new file: db.sqlite3

new file: manage.py

new file: mysqldjnago/__init__.py

new file: mysqldjnago/__pycache__/__init__.cpython-39.pyc

new file: mysqldjnago/__pycache__/settings.cpython-39.pyc

new file: mysqldjnago/__pycache__/urls.cpython-39.pyc

new file: mysqldjnago/__pycache__/wsgi.cpython-39.pyc

new file: mysqldjnago/settings.py

new file: mysqldjnago/urls.py

new file: mysqldjnago/wsgi.py

new file: readme.html

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git config --global user.email "therkmishra@gmail.com"

  2. PS C:\Users\rkmishra\source\repos\mysqldjnago> git config --global user.name "Ram Krishn Mishra"

  3. PS C:\Users\rkmishra\source\repos\mysqldjnago> git commit -m " First Django Web Application using Visual Studio"

On branch master

Untracked files:

(use "git add <file>..." to include in what will be committed)

.vs/

env/

mysqldjnago.pyproj

mysqldjnago.pyproj.user

mysqldjnago.sln

requirements.txt

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git branch

* master

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git checkout -b 'new_branch'

Switched to a new branch 'new_branch'

  1. PS C:\Users\rkmishra\source\repos\mysqldjnago> git branch

master

* new_branch

10. PS C:\Users\rkmishra\source\repos\mysqldjnago> ls


Directory: C:\Users\rkmishra\source\repos\mysqldjnago

Mode LastWriteTime Length Name

---- ------------- ------ ----

d----- 11/12/2021 6:27 PM app

d----- 12/20/2021 10:35 AM env

d----- 11/12/2021 6:27 PM mysqldjnago

d----- 11/12/2021 6:26 PM obj

-a---- 10/31/2021 10:31 AM 131072 db.sqlite3

-a---- 11/12/2021 6:25 PM 745 manage.py

-a---- 11/12/2021 6:27 PM 6985 mysqldjnago.pyproj

-a---- 11/12/2021 6:26 PM 254 mysqldjnago.pyproj.user

-a---- 11/12/2021 6:26 PM 1127 mysqldjnago.sln

-a---- 10/31/2021 10:31 AM 28423 readme.html

-a---- 10/31/2021 10:31 AM 13 requirements.txt

11. PS C:\Users\rkmishra\source\repos\mysqldjnago> git status

On branch new_branch

Untracked files:

(use "git add <file>..." to include in what will be committed)

.vs/

env/

mysqldjnago.pyproj

mysqldjnago.pyproj.user

mysqldjnago.sln

requirements.txt


nothing added to commit but untracked files present (use "git add" to track)