[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-693046-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-693046-en":130,"doc-similar-693046":148},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","git-tutorial-693046","Git Tutorial","","Git Tutorial explains how to use Git as a source code version control system for both team collaboration and solo development. It walks through the required class workflow: obtaining starter code, submitting lab work, and retrieving solutions, then proceeds with hands-on setup such as setting the EDITOR variable and configuring user.name and user.email. It covers creating a repository with git init, tracking files via staging, committing changes with messages, reviewing history using git log, and understanding file states including untracked, tracked-but-unchanged, modified-unstaged, and modified-staged.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/git-tutorial-693046/693046/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/git-tutorial-693046/693046.png","ImageObject",300,407,{"name":42,"@type":43},"Levi","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-23","2026-11-09",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",7,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"Why is Git useful even when working alone?","Question",{"text":63,"@type":64},"Git helps track changes made to your code. Even solo work benefits from history and reproducibility, not only team collaboration.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How do you configure Git with your name and email?",{"text":68,"@type":64},"Run git config --global user.name \"Your Full Name\" and git config --global user.email your_uni@columbia.edu, then confirm the information is stored in ~/.gitconfig.",{"name":70,"@type":61,"acceptedAnswer":71},"What are the main file states in a Git repository?",{"text":72,"@type":64},"A file can be Untracked, Tracked and unmodified, Tracked and modified but unstaged, or Tracked and modified and staged. The staging area (index) determines whether it is ready to commit.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},693046,1794246578,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,105,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":103,"slug":104},6,50,"technology",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":102,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":110,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":80,"read_time":117,"preview_page_count":22,"preview_urls":143},7971461740909,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Git Tutorial Jae Woo Lee, Columbia University  \nGit is a source code version control system . Such a system is most useful when you work in a team, but even when you’re working alone, it’s a very useful tool to keep track of the changes you have made to your code .  \nIn this class, you are required to use Git for doing your homework assignments (we call them labs) . You will use Git not only for coding your labs, but also for retrieving the skeleton code I provide, submitting your code, and downloading solutions.  \nThis tutorial covers not only the basic git operations that you need, but also the workflow between you, me, and the TAs--from my preparation of an assignment all the way to the grading of your submissions by the TAs . Even if you are already familiar with git, you may find the description of the workflow interesting.  \nSet EDITOR environment variable  \nType \"echo $EDITOR\" . If the shell does not respond with the name of your editor--vim, emacs, or nano--add the following line at the end of the .bashrc file in your home directory:  \nexport EDITOR=your_choice_of_editor  \nLog out and log in again. Type \"echo $EDITOR\" to make sure that your modification to .bashrc has taken effect .  \nConfigure your git environment  \nTell git your name and email:  \ngit config --global [user.name](user.name) \"Your Full Name\"  \ngit config --global [user.email](user.email) [your_uni@columbia.edu](your_uni@columbia.edu)[git stores this information in](git stores this information in) ˜/ .gitconfig  \nCreating a project  \nLet’s create a new directory, ˜/tmp/test1, for our first git project.  \ncd  \nmkdir tmp  \ncd tmp  \nmkdir test1  \ncd test1  \nPut the directory under git revision control: git init  \nIf you type ll (I’ll assume that ll is an alias for ls -alF), you will see that there is a .git directory. The git repository for the current directory is stashed in the .git directory.  \nLet’s start our programming project. Write hello .c with your editor:  \n\\#include \u003Cstdio.h>  \nint main()  \n{  \nprintf(\"%s\\n\", \"hello world\");  \nreturn 0;  \n}  \nCompile and run it:  \ngcc hello .c  \n./a.out  \nLet’s see what git thinks about what we’re doing: git status  \nThe git status command reports that hello .c and a.out are \"Untracked\" . We can have git track hello .c by adding it to the \"staging\" area (more on this later):  \ngit add hello .c  \nRun git status again. It now reports that hello .c is \"a new file tobe committed. \" Let’s commit it:  \ngit commit  \nGit opens up your editor for you to type a commit message . A commit message should succinctly describe what you’re committing in the first line. If you have more to say, follow the first line with a blank line, and then with a more through multi-line description.  \nFor now, type in the following one-line commit message, save, and exit the editor.  \nAdded hello-world program .  \nRun git status again. It now reports that only a.out is untracked . It has no mention of hello .c. When git says nothing about a file, it means that it is being tracked, and that it has not changed since it has been last committed.  \nWe have successfully put our first coding project under git revision control .  \nModifying files  \nModify hello .c to print \"bye world\" instead, and run git status . It reports that the file is \"Changed but not updated . \" This means that  \nthe file has been modified since the last commit, but it is still not ready to be committed because it has not been moved into the staging area. In git, a file must first go to the staging area before it can be committed.  \nBefore we move it to the staging area, let’s see what we changed in the file:  \ngit diff  \nOr, if your terminal supports color, git diff - -color  \nThe output should tell you that you took out the \"hello world\" line, and added a \"bye world\" line, like this:  \n- printf(\"%s\\n\", \"hello world\");  \n+ printf(\"%s\\n\", \"bye world\");  \nWe move the file to the staging area with git add command: git add hello .c  \nIn git, \"add\" means this: move the change you","cbCaimzCsEFWOzIw","https://ap.wps.com/l/cbCaimzCsEFWOzIw","pdf",12663,"English","# Git Basics\n## Class Workflow and Git Uses\n## Environment Setup (EDITOR)\n## Configure Git User Information\n## Creating a Project with git init\n## Tracking, Staging, and Committing\n## Modifying Files and Viewing Differences\n## Commit History with git log\n## File States and the Staging Index","[{\"question\":\"Why is Git useful even when working alone?\",\"answer\":\"Git helps track changes made to your code. Even solo work benefits from history and reproducibility, not only team collaboration.\"},{\"question\":\"How do you configure Git with your name and email?\",\"answer\":\"Run git config --global user.name \\\"Your Full Name\\\" and git config --global user.email your_uni@columbia.edu, then confirm the information is stored in ~/.gitconfig.\"},{\"question\":\"What are the main file states in a Git repository?\",\"answer\":\"A file can be Untracked, Tracked and unmodified, Tracked and modified but unstaged, or Tracked and modified and staged. The staging area (index) determines whether it is ready to commit.\"}]","Git Tutorial | PDF",[144],{"page_no":22,"url":145,"width":146,"height":147},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/70099fc51cbf7666ebb812b69e207bdd.webp",983,1272,{"list":149,"token":11},[150,155,161,167,173,179,185,191,197,202],{"doc_id":151,"doc_title":10,"file_type":137,"home_preview_img_url":152,"slug":153,"view_count":55,"category_name":29,"create_tm":154},693045,"https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230004257911/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=UcoMkJYS%2BD1kbLeHdiWZb60O2jg%3D","git-tutorial",1794246577,{"doc_id":156,"doc_title":157,"file_type":137,"home_preview_img_url":158,"slug":159,"view_count":22,"category_name":29,"create_tm":160},760091,"Git - A Practical, Beginner-Friendly Guide to Version Control - From Your First Commit to Branching, Merging & GitHub","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495447/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=GiKJpjYuZhMyaIqloyi1eVgbUZI%3D","git-a-practical-beginner-friendly-guide-to-version-control-from-your-first-commit-to-branching-merging-github",1795898473,{"doc_id":162,"doc_title":163,"file_type":137,"home_preview_img_url":164,"slug":165,"view_count":102,"category_name":29,"create_tm":166},682034,"A Practical Guide to Git and GitHub for Windows Users - From Beginner to Expert - Easy Step-By-Step Exercises","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332552/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=WhGIRWrV3uRdezCKEg%2F1geos72M%3D","a-practical-guide-to-git-and-github-for-windows-users-from-beginner-to-expert-easy-step-by-step-exercises",1793958635,{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":22,"category_name":29,"create_tm":172},760731,"Introduction to Git & GitHub - Course Preparation","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044249626/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=nvS1c1LYhLl3W47zG99DgG9ksBs%3D","introduction-to-git-github-course-preparation",1795908756,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":22,"category_name":29,"create_tm":178},760727,"The Modern Git & GitHub Guide - A Beginner-to-Professional Quick Reference - 2026 Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044249572/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=YWIhsbgZdCettiNWJHXdUXb6%2FDk%3D","the-modern-git-github-guide-a-beginner-to-professional-quick-reference-2026-edition",1795908750,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":102,"category_name":29,"create_tm":184},682036,"Pragmatic Guide to Git - read online free","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332684/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=Sh47pmHsONSOZI0ljeMl5Hm5MEk%3D","pragmatic-guide-to-git-read-online-free",1793958640,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":22,"category_name":29,"create_tm":190},760084,"A Lightweight API for Git - Version 0.1.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495419/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=5%2Bc0YhLLVR6hy4O3m7O%2BE5VLPqs%3D","a-lightweight-api-for-git-version-010",1795898460,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":123,"category_name":29,"create_tm":196},693047,"Beginner’s Guide to using Git","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005055448/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=ULakAE9%2BDMbKX9D0rDgAyQFugCc%3D","beginners-guide-to-using-git",1794246579,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":26,"category_name":29,"create_tm":160},760090,"Git-0 to Pro Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495433/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=dEl%2Be9gH7LCVFmE60Cpop%2FLRT6s%3D","git-0-to-pro-reference",{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":55,"category_name":29,"create_tm":207},693044,"Git and GitHub Primer - Introduction to Programming Systems COS 217","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005055419/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=EXJv181hCOd%2BlC87S7iEDKZ3%2FwM%3D","git-and-github-primer-introduction-to-programming-systems-cos-217",1794246576]