هر آنچه باید از گیت بدانیم [ دستورها و آموزش Git ]

تعریف کنترل نسخه به نقل از ویکی پدیا :
کنترل نسخه یا کنترل منبع (به انگلیسی: Revision control) عبارت است از سیستمی برای کنترل و پیگیری تغییرات واحد اطلاعاتی دخیل در ایجاد یک برنامهٔ نرمافزاری. واحد اطلاعاتی مزبور میتواند شامل فایلهای سورس، راهنماها، میک فایلها، اشیاء نرمافزاری و ... سورس کنترل به خصوص در جایی اهمیت پیدا میکند که چند برنامهنویس بخواهند روی منابع مشترکی کار کنند. در این صورت است که مفاهیمی همانند مقایسه، ترکیب، تداخل و ... پیش میآیند که سورس کنترل باید بتواند راه حل مناسبی برای هر یک ارایه دهد. امروزه معمولاً از ابزارهای نرمافزاری برای این کار استفاده میشود. با این حال هنوز هم هستند شرکتهایی که از روشهای قدیمی مانند داشتن یک فایل متن در هر پوشه، هارد کپی و ... استفاده مینمایند.
تعریف گیت به نقل از ویکی پدیا :
گیت (به انگلیسی: Git) یک نرمافزار کنترل نسخه و از مدل نرمافزارهای آزاد و متنباز برای بازنگری کد منبع توزیع شده و مدیریت منبع کد است که برای دنبال کردن تغییر فایلهای کامپیوتری و دنبال کردن کردن کارهای انجام شده روی آنها توسط افراد مختلف است. هدف اولیه این نرمافزار برای استفاده در پروژههای نرمافزار بوده است ولی میتوان از آن تنها برای دنبال کردن تغییر فایلها استفاده کرد. گیت ابتدا برای توسعهٔ لینوکس توسط لینوس تروالدز به وجود آمد و اکنون پروژههای فراوانی از آن الهام گرفتهاند. هر دایرکتوری کاری در گیت یک مخزن کامل با تاریخچهٔ کامل تغییرها و قابلیت بازنگری آنها است و برای کار با آن نیازی به دسترسی به شبکه یا سرور مرکزی وجود ندارد. گیت یک نرمافزار آزاد است که تحت عنوان جیپیال نسخه ۲ توزیع شده است.
& I [ واژه نامه ]
& Repository: جایی که فایل های جاری و تاریخچه ی آن ها و در واقع همه ی اطلاعات سیستم در آنجا ذخیره شده است (معمولا بر روی سرور
& Working Copy: فایل های محلی داخل کامپیوتر هر فرد. حتی احتمال دارد شامل تغییرات ثبت نشده در سرور هم باشند
& Trunk: شاخه ی اصلی پروژه را Trunk می گویند که در بعضی از سیستم ها به آن Master یا BaseLine هم گفته می شود.
& History: لیست تغییرات فایل یا پوشه ها که از زمان ساخت بر روی آن ها ایجاد شده است.
& Latest: آخرین نسخه از فایل یا پوشه.
& Revision: کدی از حروف یا عدد که نشان دهنده ی نسخه فایل است.
&SHA-1 (Secure Hash Algorithm)
& I [ نکته ها ]
& I در گیت اگر ۵۰ در صد فایل ها شبیه هم باشند گیت هر ۲ فایل مثل هم میدونه
& I توضیحات هر کامیت سعی کنید به صورت زمان حال بنویسید
& Git TCP Port 9418
& I [ محتویات پوشه .Git ]
.gitignore
.git
branches
COMMIT_EDITMSG
config
.config.swp
description
FETCH_HEAD
.gitignore_global
.gitignore_global.save
..gitignore_global.swp
.gitignore.save
.gitignore.save.1
..gitignore.swp
HEAD
hooks
index
info
logs
nano.save
nano.save.1
objects
ORIG_HEAD
refs
& I [ دستور ها ]
Git --Version [Git version 2.7.4]
Git Help [For more information on a specific command.]
Git Status [Show the working tree status]
Git Show [Show various types of objects]
Git Show SHA!
Git Log [Show commit logs]
Git Log --[since or until] =2016-04-05
Git Log --author="hadi"
Git Log --grep="init"
Git Log --oneline -3
Git Log --after="2 week ago"
Git Log --oneline --graph --all --decorate
Git Add [Add file contents to the index]
Git Add .
Git Commit [Record changes to the repository]
Git Commit --amend -m "New commit message" amend تغیر اخرین تغیر در مخزن با این دستور
Git Commit -am ""
Git Push [Update remote refs along with associated objects]
Git Push -u origin master
Git Pull [Fetch from and merge with another repository or a local branch]
Git Bisect [Find by binary search the change that introduced a bug]
Git Branch [List, create, or delete branches]
Git Branch -r -a
Git Merge [Join two or more development histories together]
Git Merge --abort
Git Checkout [Checkout a branch or paths to the working tree]
Git Checkout-b change_title
Git Checkout tags/tag_name
Git Clone [Clone a repository into a new directory]
Git Diff [Show changes between commits, commit and working tree, etc]
Git Fetch [Download objects and refs from another repository]
Git Grep [Print lines matching a pattern]
Git Init [Create an empty git repository or reinitialize an existing one]
Git Mv [Move or rename a file, a directory, or a symlink]
Git mv 123.txt 321.txt قابلیت حرکت دادن و تغیر اسم
Git Rebase [Forward-port local commits to the updated upstream head]
Git Reset [Reset current HEAD to the specified state]
Git Reset HEAD index.html
Git Reset --soft --mixed --hard
Git Rm [Remove files from the working tree and from the index]
Git Tag [Create, list, delete or verify a tag object signed with GPG]
Git Tag -l
Cat .git/HEAD
ref: refs/heads/master
cat .git/refs/heads/master :[SHA1]Git Remote -v
Git Clean -i
Git Revert SHA5f68hx3467
Git Gc --prune جمعآوری آشغالهاGit Config
Git Config --list
Git Config --system
Git Config --global
Git Config credential.helper storeGit Stash Save "Massage"
Git Stash List
Git Stash Pop Stash@(1)
Git Stash Apply
Git Stash Drop پاک کردن
Git Stash Clear
usage: git [--version] [--exec-path[=<path>]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
[-c name=value] [--help]
<command> [<args>]
git ls-files [-z] [-t] [-v]
(--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
(-[c|d|o|i|s|u|k|m])*
[--eol]
[-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>]
[--exclude-per-directory=<file>]
[--exclude-standard]
[--error-unmatch] [--with-tree=<tree-ish>]
[--full-name] [--recurse-submodules]
[--abbrev] [--] [<file>…]
& I [ چرک نویس ]
Mkdir Test
Cd Test
Git ls -tree
Cat .Git/Config
Sudo Touch .GitKraken
Head pointer
t56hh65..fh46h6 [..تا]& [] Git global setup [GitLab]
git config --global user.name "H"
git config --global user.email "H@gmail.com"
& [] Create a new repository
git clone https://
cd a
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
& [] Existing folder
cd existing_folder
git init
git remote add origin https://
git add .
git commit -m "Initial commit"
git push -u origin master
& [] Existing Git repository
cd existing_repo
git remote add origin https:/
git push -u origin --all
git push -u origin --tags
& I [ ابزارها ]
https://gitter.im/
https://libgit2.github.com/
https://gitlab.com/users/sign_in
https://rawgit.com/
https://github.com/login
https://github.com/jwasham/coding-interview-university
https://github.com/firehol/netdata/wiki
https://github.com/joshbuchea/HEAD
https://www.gitbook.com/
https://account.gitkraken.com/home
http://www.bitkeeper.org/
https://bitbucket.org/
http://gitref.org/
https://git-scm.com/download/gui/linux#
http://rogerdudler.github.io/git-guide/
https://packagecontrol.io/
https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud
https://motale.visualstudio.com/Project/_git/Hadi/history?_a=history
https://forum.gitlab.com/
http://www.commitlogsfromlastnight.com/
https://git.io/
https://www.gitignore.io/
https://octodex.github.com/apt-get install giggle
https://git-cola.github.io/
https://scitools.com/gitahead
https://www.syntevo.com/smartgit/
https://wiki.gnome.org/Apps/Gitg/
https://www.collab.net/downloads/giteye
https://www.cycligent.com/git-tool-download
& I [ منابع آموزشی ]
https://git-scm.com/book/fa/v1/%D8%B3%D8%B1%D8%A2%D8%BA%D8%A7%D8%B2
https://git-scm.com/book/en/v2
https://try.github.io/levels/1/challenges/1
https://services.github.com/training/
https://www.codeschool.com/courses/try-git
https://backlogtool.com/git-guide/en/
https://www.youtube.com/playlist?list=PL3Y-E4YSE4wa_TUfN7G3rAMIiu6vIeepT
https://www.youtube.com/GitHubGuides
& I [ چند نکته ]
نکته: حروف بزرگ و کوچک رعایت کنید
نکته: این پیج بیشتر جنبه شخصی دارد برای دسترسی سریع به منابع مورد نیاز
& I [ کلمات کلیدی ]
گیت گیت کراکن گیت لب گیت هاب کنترل نسخه git github gitlab
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .