1. git is a vms/vcs version control system
2. git so fast, off line work
3. most necessity of git (code revision)
Keep in mind that it takes
->commit(লোকাল এ যে কাজগুলি করেছেন সেগুলোকে রেকড করা)
->push (আপনি লোকাল এ যে কাজগুলি করেছেন সেগুলোকে সারভারে তোলা)
->pull (সারভারে থেকে কাজগুলি লোকাল এ নামানো)
git some of tools
-> status [check]
-> add [file add to git]
-> diff [if you want to see which line is modified]
-> log [if you want to see whole day work]
-> show [show up by individual hash id]
-> checkout [How was the whole project, if you want to go there]
-> reset
-> reflog
-> branch
-> merge
-> stash
Git bash cmd:
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark
$ ls [just check, is there have any file?]
$ git init [git initialized]
Initialized empty Git repository in E:/xampp/htdocs/nedstark/.git/
$ ls -al [list of all file]
$ echo "" > new.txt [new file include in git]
$ git status
Untracked files:
nothing added to commit but untracked files present (use "git add" to track)
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git add new.txt [file add to git]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git status
new file: new.txt
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git commit -m "added some text" [changed file to be record]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git status
On branch master
nothing to commit, working directory clean
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git status
modified: new.txt
$ git diff [if you want to see which line is modified]
diff --git a/new.txt b/new.txt
Hello world
+
+
+Hello jupiter
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git commit -m "added some more text" new.txt
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git status
On branch master
nothing to commit, working directory clean
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git log [if you want to see whole day work]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git show 95fdea [individual hash id]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git checkout 95fdea [How was the whole project, if you want to go there]
Note: checking out '95fdea'.
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark ((7588b3e...))
$ cat new.txt [if you want to see file content]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark ((7588b3e...))
$ git checkout master [if you want to back last commit]
Switched to branch 'master'
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git log
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git reset --soft 95fdea [soft reset]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git diff HEAD [if you want to see changed line]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git reset --hard 95fde [Hard reset]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git reflog [if you want to back reset file]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git reset HEAD@{1}
Unstaged changes after reset:
M ami.txt
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git reset --hard
HEAD is now at 9999cf3 Three
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git stash [Temporary save]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git stash pop [return code from stash]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git stash list [list of stash]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git stash clear [if you want to clear stash list]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git remote add origin https://github.com/md-ataur/git-test.git
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git remote show
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git remote show origin
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git push origin master
Username for 'https://github.com': md-ataur
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git pull origin master
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ echo "" > .gitignore
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git status
On branch master
Untracked files:
.gitignore [edit page and put this *.zip]
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git add new.zip
The following paths are ignored by one of your .gitignore files:
new.zip
Use -f if you really want to add them.
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git add .gitignore
Dell@Dell-PC MINGW64 /e/xampp/htdocs/nedstark (master)
$ git commit -am "gitignore"
Like this:
Like Loading...
Related