The document describes various commands used for source code version control with Git and basic Linux file and directory commands. It includes commands for initializing and configuring Git repositories, adding and committing files, branching, merging, tagging, viewing commit logs and diffs, pushing and pulling from remote repositories, and basic file operations like copying, moving, renaming, deleting files, creating and changing directories, and installing packages.
The document describes various commands used for source code version control with Git and basic Linux file and directory commands. It includes commands for initializing and configuring Git repositories, adding and committing files, branching, merging, tagging, viewing commit logs and diffs, pushing and pulling from remote repositories, and basic file operations like copying, moving, renaming, deleting files, creating and changing directories, and installing packages.
The document describes various commands used for source code version control with Git and basic Linux file and directory commands. It includes commands for initializing and configuring Git repositories, adding and committing files, branching, merging, tagging, viewing commit logs and diffs, pushing and pulling from remote repositories, and basic file operations like copying, moving, renaming, deleting files, creating and changing directories, and installing packages.
cat filename - show data in file. git config --global user.name/email "name/mail id" -for create init. git status - list of all new or modified files to be commited. git init - git initialising. git init [project name] - create a new local repo with the specified argument. git --version - to know your git version. git config --global user.name "[user-name]" - define the name you want associated with your commit transactions. git config --global user.email "[user-email]" - defines the email address you want associated with your commit transaction. git config --global color.ui auto - turn on colorization of command line output. git add [filename] - prepairs the file for commit by logically moving it to the staged area. git add . - for before commit using add . command [for going to staging area on git] git rm --cached <filename> - for unstage file. git clean -f - delete untrack/useless files. git clean -n - delete untrack/useless files. git ls-files --stage - lists all the files in the staged area. git commit -m "commit massage" - adds the staged files permanently in version history. git diff - shows unstaged files difference. git diff --staged - shies file difference between staging and the last file version. git branch - list branches . git checkout -b [branch-name] - enter into new branch. git checkout [branch-name] - switches to the specified branch and updates the working directory. git merge [brach-name] - combines the specified branch's data with the master branch. git branch <branch name> - to create a branch. git branch -d [branch-name] - delete the specified branch. git branch -D [branch name] - delete forcefully a specific branch in working condition also. git branch - to check in which branch u are/how many branches are there. git branch - know about how many branch you have. git stash - to stash an item. git stash list - to see stash items list. git stash apply <copy stash-number> - to apply stashed items. git stash clear - to clear stash items. git reset <filename> - to reset from staging area to working area. git reset . - for back to from staging area to working area. git reset --hard - for delete data from both staging area and working area. git restore <filename> - to delete/discard changes in working area. git rm [file-name] - deletes the file from the working directory and the staging area. git log -1 - to get the recent commit. git log -2 - to get the last 2 commits. git log - for file/commit Id creator details. git log --oneline - list version history in one line for the current branch. git log -online -decorate --graph - list version history in one line,decorated in graphical from for the current branch. git log -<number of recent-commit> - for get some coomit from starting. git log --oneline - for get one line commit formats. git log grep "ignore" - for findout the ignore-names commit. git log --grep "name of massege" - find out the specific name of commit file. git show <commit id> - for show in commit file. git remote add origin <git-hub repo url> - for connection/add. with your git hub. git push [alias] [branch] - upload all local branch commits to remote repo. git push -u origin master - for push to github. git remote add origin <git-hub repo url> - for connect local repo with git hub. git pull - downloads from remote repo and incoporates changes. git pull -u origin master - for pull data from git-hub. git remote add origin <url-repo> - for connect with git-hub for pull the package. git pull origin master - for pull package the commit packages. git push origin master - push your data to git-hub. vi .ignore - for enter ignore format file. git clone [repo-url] - clones an existing repo. git rebase [branch-name] - rebase your current head onto branch. git rebase -i - used to being an interactive rebasing session,this provides all the benifits of normal rebase,but gives you the opportunity to add,edit or delete commits. git stash -temporarily stores all modified tracked files. git revert <commit id> - the revert command helps you undo or existing commit. git tag -a <tagname> -m <message> <commit-10> - to apply tag. git tag - to see the list of tags. git show <tagname> - to see particular commit content by using tag. git tag -d <tagname> - to delete a tag. git clone <url of git-hub repo> - it create a local repo automaticallyin linux machine with the same name as in git-hub account. touch filename - create empty files. touch -a filename - for change access time. touch -m filename - for change modify time . vi filename - edit data file. nano filename - create files & add data. mkdir <directoryname> - create directory/folders. mkdir <dir1/dir2/dir3> - create separation directory or folders. cd <directory name>- chage directory. cd .. - for back to directory. pwd - present working directory. history - looking using commands. cp <source filename> <destination/newfile> - copy data file to file/directory. mv <source filename> <destination file/directory> - move data file to file/directory. mv <old filename> <new filename> - rename/recreate a new file. rm -rf <filename/directory name> - for remove a file/drectory. hostname -i - for IP address. cat /etc/os-release (default) - for absolute path. useradd - to create user. group add - to create group. gpasswd -a/-m - to add user into group to add multiple user. ln <filename> <hardlink-filename> - to create a hardlink file (backup-file). ln -s <filename> <softlink-filename> - tocreate a softlink (short-cut). tar -cvf <directory name.tar> <directory name> - to create a tar file. tar -xvf <tar filename> - to free from tar that file. gzip <tar file name> - to create a gzip file. gunzip <gzip-filename> - to free from gzip file. wget <url> - for download packages. yum install <package-name> - for install packages in linux. yum remove <package-name> - to remove/delete the package. yum update - for update packages in linux. service <package name> start - for start package. service <package nmae> stop - for stop package. service <package name> status - for about status package. tree - for look the details of files and directories as a tree concet. chmod <777> <file/directory name> - used to change the access mode of a file. chown <new filename> <old filename> - change the owner of file/directory. chgrp <groupname> <filename> - change the group of file/directory.