Git Tutorial
Git Tutorial
Git Tutorial
1696]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Argha>cd \
C:\>git
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
[--config-env=<name>=<envvar>] <command> [<args>]
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
diff Show changes between commits, commit and working tree, etc
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
C:\>cd gittest
C:\gittest>git branch
fatal: not a git repository (or any of the parent directories): .git
C:\gittest>cd StudyProjects
C:\gittest\StudyProjects>git branch
* master
C:\gittest\StudyProjects>git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
C:\gittest\StudyProjects>git branch -r
origin/HEAD -> origin/master
origin/master
C:\gittest\StudyProjects>git branch
devproj
* master
C:\gittest\StudyProjects>git status
On branch devproj
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: Untitled4.ipynb
no changes added to commit (use "git add" and/or "git commit -a")
C:\gittest\StudyProjects>git status
On branch devproj
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: Untitled4.ipynb
Run
C:\gittest\StudyProjects>git init
Reinitialized existing Git repository in C:/gittest/StudyProjects/.git/
C:\gittest\StudyProjects>git branch
* devproj
master
C:\gittest\StudyProjects>git branch -a
* devproj
master
remotes/origin/HEAD -> origin/master
remotes/origin/devproj
remotes/origin/master
C:\gittest\StudyProjects>git branch
* devproj
master
C:\gittest\StudyProjects>git branch -a
* devproj
master
remotes/origin/HEAD -> origin/master
remotes/origin/devproj
remotes/origin/master
C:\gittest\StudyProjects>git branch -a
* devproj
master
remotes/origin/HEAD -> origin/master
remotes/origin/devproj
remotes/origin/master
remotes/origin/testproj
C:\gittest\StudyProjects>git branch
devproj
master
* testproj
C:\gittest\StudyProjects>git status
On branch testproj
Your branch is up to date with 'origin/testproj'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: testaddfile.txt
C:\gittest\StudyProjects>git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 16 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 287 bytes | 287.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/argharaha/StudyProjects.git
85834a7..5caaa8d testproj -> testproj
C:\gittest\StudyProjects>