GIT
GIT Docs
Installation (Windows)
Download GIT from here
Sample GIT installation screenshots git-screenshots.rar
Download Tortoise GIT from here
Sample Tortoise GIT installation screenshots tortoise-git.rar
OR
IT team : Download git-process.rar and follow readme.txt
Installation (Linux)
Configuration
Configure user name
Configure email
Configure all
Set editor instead command line editing (windows)
Note : 'notepad++' system environment variable must be set else specify full path
Set beyond compare (bc) as difftool (windows)
Note: beyond compare docs
SSH Setup for Git Server (ASL)
Note :
- key will be at Ubuntu : "/home/specificUser/.ssh" or Windows : "C:\Users\specificUser.ssh" folder
- default keys : id_rsa (private key), id_rsa.pub (public key)
Commands
Basic main commands
Create new repository
Clone new repository
Check status
Stage(select) new or existing files
Unstaging files
Delete
Rename
Commit(local)
Push(remote)
Basic other commands
check log/ history
diff
reset (after local commit also)
Branches
More commands
help
Tags
show
stash
revert
remote
merge
rebase
Later
** connect domain users in git repo server & use access control in that way instead of shh ?
Issues
- If Filename too long error, run following
Splitting subfolders as GIT repo
move subfolder history & data to new branch
create blank repo & pull particular branch data
Converting client repo to server bare repo
Just have .git folder & it's setting "core.bare = true"
Reducing git size
- find git repo size
- Make current commit as the initial commit & delete old history
- Note : You should delete all other branches and tags, because it may still contain the old history.
Tortoise GIT Usage
official docs
Regular Commit case
- (right click) TortoiseGIT -> pull
- (right click) GIT commit
- Select (checkbox) files to commit
- Write commit message
- press "commit & push" button
GIT Pull Error
Pull Error comes when Somebody has committed the same file on which you are working.
(right click) TortoiseGIT -> pull
Click Ok
Pull will be rejected. Error message will also show the file name which has issue
Take backup of the file
Go to the repo folder->(right click) TortoiseGIT -> Revert
Select (checkbox) the file -> Click Ok
Pull again
GIT Push Error
Push error comes when you try to push without taking pull.
Commit and Push your files
Push rejected
Take backup of your files or whole repo folder.
Go to repo folder -> (right click) TortoiseGIT -> Show Log
origin/master and master will be on different commits as your changes are not pushed to server
right click on origin/master commit -> Reset "master" to this..
Click Ok
Reset will be success
Take pull and then check log by right clicking in repo folder -> TortoiseGIT -> Show Log. You will see someone has committed.
Add your changes to repo folder from backup then again Commit & Push
Revision History
Date | Version | Description | Author | Reviewed By | Reviewed Date | Remarks |
---|---|---|---|---|---|---|
04-12-2019 | 1.0.0 | Initial Content | Prasan Kumar | Pending | ||
16-12-2019 | 1.1.0 | Added Splitting subfolders as GIT repo | Prasan Kumar | Pending | ||
08-01-2020 | 1.2.0 | Added Tortoise GIT link and Tortoise GIT installation screenshots | Prasan Kumar | Pending |