Git Basics Git Expertise

Total Page:16

File Type:pdf, Size:1020Kb

Git Basics Git Expertise Overview Git basics Git expertise Git A GNU Alternative to Bitkeeper Mohamed Barakat University of Kaiserslautern ITWM Kaiserslautern, January 2010 Mohamed Barakat Git Overview Git basics Git expertise 1 Git basics The Git configuration file Create a Git-repository Using a Git-repository 2 Git expertise Branching Pulling Merging and Cherry-Picking Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Overview 1 Git basics The Git configuration file Create a Git-repository Using a Git-repository 2 Git expertise Branching Pulling Merging and Cherry-Picking Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Git working copy and Git-repsoitory Git is a distributed SCM Git is a distributed Source Code Management system (SCM), i.e. each Git working copy sits on top of its own local Git repository located in a single top-level subdirectory .git. SVN is in contrast to Git a centralized SCM system, i.e. the SVN-repository is on exactly one server. Git allows you to commit, checkout, reset, etc. without contacting a server! Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository The configuration file ˜/.gitconfig Create a Git configuration file vi ˜/.gitconfig [svn] authorsfile = .git/info/svn-authors [color] diff = auto status = auto branch = auto [user] name = Firstname Lastname email = [email protected] Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Create a Git-repository (quick version) init, add, commit Create a Git-repository in the directory XY: 1 cd XY 2 git init 3 git add . 4 git commit -a Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Create a Git-repository (elaborate version) init, status, add, commit Create a Git-repository in the directory XY: 1 cd XY 2 git init 3 git status Specify files and directories to ignore (understands wildcards): 4 vi .gitignore 5 git add . 6 git commit -a Give a name to the repository: 7 vi .git/description Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Clone a local Git-repository clone Clone a local Git-repo of the project abc in the directory git.repos: 1 cd git.repos 2 git clone /path_to_local_directory/abc The Git-repo is now under abc. Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Clone a remote Git-repository (using the Git-Protokoll) clone git:// Clone a remote Git-repo of the project abc in the directory git.repos: 1 cd git.repos 2 git clone git://remote.host/path/abc The Git-repo is now under abc. Requires a running Git-server on the remote host. Git supports HTTP in addition to its own protocol. CAUTION: Git over HTTP is slow for huge projects. Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Clone a remote Git-repository (via SSH) clone git+ssh:// Clone a remote Git-repo of the project abc in the directory git.repos: 1 cd git.repos 2 git clone git+ssh://[email protected]/path/abc The Git-repo is now under abc. Requires an SSH-account on the remote host. Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Clone a remote SVN-repository (via SSH) clone svn+ssh:// Clone a remote SVN-repo of the project cba in the directory git.repos: 1 cd git.repos 2 git svn clone svn+ssh://[email protected]/path/cba The Git-repo is now under cba. Requires an SSH-account on the remote host. Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Working copy, index, repo The notions working copy and repository are known to SVN users.The index is a powerful new concept in Git, although for newcomers rather confusing. It allows a sort of “pre-commit”. add The Git-option add is used to pre-commit in the index. There are several ways to use the option add: git add file1 subdirectory1/*.c subdirectory2/file2 git add . git add -a or the cool patch mode git add -p file1 subdirectory1/*.c subdirectory2/file2 git add -p Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Getting help To learn more about a Git-option xyz invoke: git xyz -h or man git-xyz Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Status of working tree, index, repo To learn about the current status of your working copy, index, and repository invoke the following command inside any subdirectory of your repo: status git status # On branch master nothing to commit (working directory clean) By repository we sometimes mean the HEAD of the repository. Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Status of working copy, index, repo How things look like when working copy, index, and repo all differ: git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: basic.h # modified: basic.c # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working dir) # # modified: basic.c # modified: core.c # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # modified: advanced.c Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Working tree, index, HEAD of repo “git status” suggested two further Git-options: reset file git reset HEAD basic.h or simply git reset basic.h Resets the index to the HEAD of the repository, leaving the working copy untouched! So: git reset basic.h = (git add basic.h)−1 Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Working tree, index, HEAD of repo checkout file git checkout basic.c Resets the working copy of the file basic.c to the index (and not to the HEAD of the repository!), discarding all changes since the last “git add”. In order to reset the working copy to the HEAD invoke checkout HEAD file git checkout HEAD basic.c Resets the working copy of the file basic.c and the index entry to the HEAD of the repository, discarding all changes since the last “git commit”. Mohamed Barakat Git Overview The Git configuration file Git basics Create a Git-repository Git expertise Using a Git-repository Working tree, index, HEAD of repo Another difference to SVN: commit git commit commits the index only, and not the working copy! The index becomes the new HEAD. while commit -a git commit -a is the classical commit of the working copy. This is the same as: 1 git add -a 2 git commit Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking Overview 1 Git basics The Git configuration file Create a Git-repository Using a Git-repository 2 Git expertise Branching Pulling Merging and Cherry-Picking Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking The tree Each Git working copy lives over a Git repository. A Git repository is a tree with an initial point. A vertex of this tree is called a commit. A Git repository has no trunk, i.e. even if the user distinguishes a branch (e.g. by calling it “master”) Git handles all branches of its tree on an equal footing! The different Git-repositories of the different users worldwide can be regarded as a single super tree, provided they share the same initial commit. In this super-tree, branches are distinguished not by their names, but by the commit-id’s of their commits. A commit-id of a commit is a SHA string which encodes the commit and all preceding commits in the branch. Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking Branching branch, checkout git branch devel creates a new branch named “devel” (without “switching to it”). The branch is forked from HEAD. The command git checkout devel is used to “switch” to the branch devel (at any time), provided the index is clean, i.e. no files were added to the index since the last “git commit”. checkout -b The following combines the two previous commands in one step: git checkout -b devel Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking View branch log To view the current branch. git log To view the branch “experiment” git log experiment Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking Pulling To pull Frank’s “devel”-branch of the abc project from the remote computer other.host invoke pull 1 Ensure a clean working copy, i.e. no further changes since the last “git commit -a”. create a new branch for pulling Frank’s “devel”-branch, unless you already have one 2 git branch frank 3 git checkout frank 4 git pull [email protected]/˜frank/repos.git/abc devel Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking Merging If you like Frank’s work and want to merge it with your “devel”-branch do merge 1 git checkout devel 2 git merge frank Mohamed Barakat Git Overview Branching Git basics Pulling Git expertise Merging and Cherry-Picking Cherry-Picking If you want a certain commit from Frank’s branch do cherry-pick 1 git checkout devel 2 git cherry-pick ecc68 where ecc68 is the (unique) beginning of the SHA commit-id of Frank’s desired commit.
Recommended publications
  • Generating Commit Messages from Git Diffs
    Generating Commit Messages from Git Diffs Sven van Hal Mathieu Post Kasper Wendel Delft University of Technology Delft University of Technology Delft University of Technology [email protected] [email protected] [email protected] ABSTRACT be exploited by machine learning. The hypothesis is that methods Commit messages aid developers in their understanding of a con- based on machine learning, given enough training data, are able tinuously evolving codebase. However, developers not always doc- to extract more contextual information and latent factors about ument code changes properly. Automatically generating commit the why of a change. Furthermore, Allamanis et al. [1] state that messages would relieve this burden on developers. source code is “a form of human communication [and] has similar Recently, a number of different works have demonstrated the statistical properties to natural language corpora”. Following the feasibility of using methods from neural machine translation to success of (deep) machine learning in the field of natural language generate commit messages. This work aims to reproduce a promi- processing, neural networks seem promising for automated commit nent research paper in this field, as well as attempt to improve upon message generation as well. their results by proposing a novel preprocessing technique. Jiang et al. [12] have demonstrated that generating commit mes- A reproduction of the reference neural machine translation sages with neural networks is feasible. This work aims to reproduce model was able to achieve slightly better results on the same dataset. the results from [12] on the same and a different dataset. Addition- When applying more rigorous preprocessing, however, the per- ally, efforts are made to improve upon these results by applying a formance dropped significantly.
    [Show full text]
  • Introduction to Version Control with Git
    Warwick Research Software Engineering Introduction to Version Control with Git H. Ratcliffe and C.S. Brady Senior Research Software Engineers \The Angry Penguin", used under creative commons licence from Swantje Hess and Jannis Pohlmann. March 12, 2018 Contents 1 About these Notes1 2 Introduction to Version Control2 3 Basic Version Control with Git4 4 Releases and Versioning 11 Glossary 14 1 About these Notes These notes were written by H Ratcliffe and C S Brady, both Senior Research Software Engineers in the Scientific Computing Research Technology Platform at the University of Warwick for a series of Workshops first run in December 2017 at the University of Warwick. This document contains notes for a half-day session on version control, an essential part of the life of a software developer. This work, except where otherwise noted, is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Li- cense. To view a copy of this license, visit http://creativecommons.org/ licenses/by-nc-nd/4.0/. The notes may redistributed freely with attribution, but may not be used for commercial purposes nor altered or modified. The Angry Penguin and other reproduced material, is clearly marked in the text and is not included in this declaration. The notes were typeset in LATEXby H Ratcliffe. Errors can be reported to [email protected] 1.1 Other Useful Information Throughout these notes, we present snippets of code and pseudocode, in particular snippets of commands for shell, make, or git. These often contain parts which you should substitute with the relevant text you want to use.
    [Show full text]
  • Distributed Configuration Management: Mercurial CSCI 5828 Spring 2012 Mark Grebe Configuration Management
    Distributed Configuration Management: Mercurial CSCI 5828 Spring 2012 Mark Grebe Configuration Management Configuration Management (CM) systems are used to store code and other artifacts in Software Engineering projects. Since the early 70’s, there has been a progression of CM systems used for Software CM, starting with SCCS, and continuing through RCS, CVS, and Subversion. All of these systems used a single, centralized repository structure. Distributed Configuration Management As opposed to traditional CM systems, Distributed Configuration Management Systems are ones where there does not have to be a central repository. Each developer has a copy of the entire repository and history. A central repository may be optionally used, but it is equal to all of the other developer repositories. Advantages of Distributed Configuration Management Distributed tools are faster than centralized ones since metadata is stored locally. Can use tool to manage changes locally while not connected to the network where server resides. Scales more easily, since all of the load is not on a central server. Allows private work that is controlled, but not released to the larger community. Distributed systems are normally designed to make merges easy, since they are done more often. Mercurial Introduction Mercurial is a cross-platform, distributed configuration management application. In runs on most modern OS platforms, including Windows, Linux, Solaris, FreeBSD, and Mac OSX. Mercurial is written 95% in Python, with the remainder written in C for speed. Mercurial is available as a command line tool on all of the platforms, and with GUI support programs on many of the platforms. Mercurial is customizable with extensions, hooks, and output templates.
    [Show full text]
  • Higher Inductive Types (Hits) Are a New Type Former!
    Git as a HIT Dan Licata Wesleyan University 1 1 Darcs Git as a HIT Dan Licata Wesleyan University 1 1 HITs 2 Generator for 2 equality of equality HITs Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory [Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg] 2 Generator for 2 equality of equality HITs Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory [Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg] Higher inductive types (HITs) are a new type former! 2 Generator for 2 equality of equality HITs Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory [Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg] Higher inductive types (HITs) are a new type former! They were originally invented[Lumsdaine,Shulman,…] to model basic spaces (circle, spheres, the torus, …) and constructions in homotopy theory 2 Generator for 2 equality of equality HITs Homotopy Type Theory is an extension of Agda/Coq based on connections with homotopy theory [Hofmann&Streicher,Awodey&Warren,Voevodsky,Lumsdaine,Garner&van den Berg] Higher inductive types (HITs) are a new type former! They were originally invented[Lumsdaine,Shulman,…] to model basic spaces (circle, spheres, the torus, …) and constructions in homotopy theory But they have many other applications, including some programming ones! 2 Generator for 2 equality of equality Patches Patch a a 2c2 diff b d = < b c c --- > d 3 3 id a a b b
    [Show full text]
  • Homework 0: Account Setup for Course and Cloud FPGA Intro Questions
    Cloud FPGA Homework 0 Fall 2019 Homework 0 Jakub Szefer 2019/10/20 Please follow the three setup sections to create BitBucket git repository, install LATEX tools or setup Overleaf account, and get access to the course's git repository. Once you have these done, answer the questions that follow. Submit your solutions as a single PDF file generated from a template; more information is at end in the Submission Instructions section. Setup BitBucket git Repository This course will use git repositories for code development. Each student should setup a free BitBucket (https://bitbucket.org) account and create a git repository for the course. Please make the repository private and give WRITE access to your instructor ([email protected]). Please send the URL address of the repository to the instructor by e-mail. Make sure there is a README:md file in the repository (access to the repository will be tested by a script that tries to download the README:md from the repository address you share). Also, if you are using a Apple computer, please add :gitignore file which contains one line: :DS Store (to prevent the hidden :DS Store files from accidentally being added to the repository). If you have problems accessing BitBucket git from the command line, please see the Appendix. Setup LATEX and Overleaf Any written work (including this homework's solutions) will be submitted as PDF files generated using LATEX [1] from provided templates. Students can setup a free Overleaf (https://www. overleaf.com) account to edit LATEX files and generate PDFs online; or students can install LATEX tools on their computer.
    [Show full text]
  • Version Control – Agile Workflow with Git/Github
    Version Control – Agile Workflow with Git/GitHub 19/20 November 2019 | Guido Trensch (JSC, SimLab Neuroscience) Content Motivation Version Control Systems (VCS) Understanding Git GitHub (Agile Workflow) References Forschungszentrum Jülich, JSC:SimLab Neuroscience 2 Content Motivation Version Control Systems (VCS) Understanding Git GitHub (Agile Workflow) References Forschungszentrum Jülich, JSC:SimLab Neuroscience 3 Motivation • Version control is one aspect of configuration management (CM). The main CM processes are concerned with: • System building • Preparing software for releases and keeping track of system versions. • Change management • Keeping track of requests for changes, working out the costs and impact. • Release management • Preparing software for releases and keeping track of system versions. • Version control • Keep track of different versions of software components and allow independent development. [Ian Sommerville,“Software Engineering”] Forschungszentrum Jülich, JSC:SimLab Neuroscience 4 Motivation • Keep track of different versions of software components • Identify, store, organize and control revisions and access to it • Essential for the organization of multi-developer projects is independent development • Ensure that changes made by different developers do not interfere with each other • Provide strategies to solve conflicts CONFLICT Alice Bob Forschungszentrum Jülich, JSC:SimLab Neuroscience 5 Content Motivation Version Control Systems (VCS) Understanding Git GitHub (Agile Workflow) References Forschungszentrum Jülich,
    [Show full text]
  • Scaling Git with Bitbucket Data Center
    Scaling Git with Bitbucket Data Center Considerations for large teams switching to Git Contents What is Git, why do I want it, and why is it hard to scale? 01 Scaling Git with Bitbucket Data Center 05 What about compliance? 11 Why choose Bitbucket Data Center? 13 01 What is Git, why do I want it, and why is it hard to scale? So. Your software team is expanding and taking on more high-value projects. That’s great news! The bad news, however, is that your centralized version control system isn’t really cutting it anymore. For growing IT organizations, Some of the key benefits Codebase safety moving to a distributed version control system is now of adopting Git are: Git is designed with maintaining the integrity considered an inevitable shift. This paper outlines some of managed source code as a top priority, using secure algorithms to preserve your code, change of the benefits of Git as a distributed version control system history, and traceability against both accidental and how Bitbucket Data Center can help your company scale and malicious change. Distributed development its Git-powered operations smoothly. Community Distributed development gives each developer a working copy of the full repository history, Git has become the expected version control making development faster by speeding up systems in many circles, and is very popular As software development increases in complexity, and the commit process and reducing developers’ among open source projects. This means its easy development teams become more globalized, centralized interdependence, as well as their dependence to take advantage of third party libraries and on a network connection.
    [Show full text]
  • New York Software Symposium New York Information Technology Center June 24 - 25, 2011
    New York Software Symposium New York Information Technology Center June 24 - 25, 2011 Fri, Jun. 24, 2011 Room 2 Room 3 Room 4 Room 5 Room 6 8:00 - 9:00 AM REGISTRATION/BREAKFAST/WELCOME 9:00 - 10:30 AM Slimmed Down Software: Busy Java Developer&apos;s Sonar: Code Quality Programming HTML5 Concurrency without A Lean Approach Guide to Java 7 Metrics Made Easy Tim Berglund pain in pure Java Hamlet D`Arcy Ted Neward Matthew McCullough Venkat Subramaniam 10:30 - 11:00 AM BREAK 11:00 - 12:30 PM New Ideas for Old Code Busy Java Developer&apos;s Open Source Debugging NoSQL Smackdown! Collections for Concurrency Hamlet D`Arcy Guide to Games Tools for Java Tim Berglund Venkat Subramaniam Ted Neward Matthew McCullough 12:30 - 2:30 PM LUNCH & KEYNOTE 2:30 - 4:00 PM Pragmatic Architecture Java Boilerplate Busters Cascading through Hadoop: A Getting Started with Grails Programming in Functional Style Ted Neward Hamlet D`Arcy DSL for Simpler MapReduce Tim Berglund Venkat Subramaniam Matthew McCullough 4:00 - 4:30 PM BREAK 4:30 - 6:00 PM How to Select and Architectural Kata Workshop Resource-Oriented Cassandra: Radical Scala for the Intrigued Adopt a Technology Ted Neward Architectures : REST I NoSQL Scalability Venkat Subramaniam Peter Bell Brian Sletten Tim Berglund New York Software Symposium New York Information Technology Center June 24 - 25, 2011 Sat, Jun. 25, 2011 Room 2 Room 3 Room 4 Room 5 Room 6 8:00 - 9:00 AM BREAKFAST 9:00 - 10:30 AM Cryptography on the Resource-Oriented Integrating JVM Languages Complexity Theory and Busy Java Developer&apos;s
    [Show full text]
  • INF5750/9750 - Lecture 1 (Part III) Problem Area
    Revision control INF5750/9750 - Lecture 1 (Part III) Problem area ● Software projects with multiple developers need to coordinate and synchronize the source code Approaches to version control ● Work on same computer and take turns coding ○ Nah... ● Send files by e-mail or put them online ○ Lots of manual work ● Put files on a shared disk ○ Files get overwritten or deleted and work is lost, lots of direct coordination ● In short: Error prone and inefficient The preferred solution ● Use a revision control system. RCS - software that allows for multiple developers to work on the same codebase in a coordinated fashion ● History of Revision Control Systems: ○ File versioning tools, e.g. SCCS, RCS ○ Central Style - tree versioning tools. e.g. CVS ○ Central Style 2 - tree versioning tools e.g. SVN ○ Distributed style - tree versioning tools e.g. Bazaar ● Modern DVCS include Git, Mercurial, Bazaar Which system in this course? ● In this course we will be using GIT as the version control system ● We will use the UIO git system, but you can also make git accounts on github.com or bitbucket for your own projects ● DHIS2 uses a different system: Launchpad/Bazaar How it works Working tree: Local copy of the source code Repository: residing on the Central storage of developer’s the source code at computer (a client) a server synchronize synchronize Commit Commit locally Centralized De-centralized The repository Central ● Remembers every change ever written to it (called commits) ● You can have a central or local repository. ○ Central = big server in
    [Show full text]
  • Hg Mercurial Cheat Sheet Serge Y
    Hg Mercurial Cheat Sheet Serge Y. Stroobandt Copyright 2013–2020, licensed under Creative Commons BY-NC-SA #This page is work in progress! Much of the explanatory text still needs to be written. Nonetheless, the basic outline of this page may already be useful and this is why I am sharing it. In the mean time, please, bare with me and check back for updates. Distributed revision control Why I went with Mercurial • Python, Mozilla, Java, Vim • Mercurial has been better supported under Windows. • Mercurial also offers named branches Emil Sit: • August 2008: Mercurial offers a comfortable command-line experience, learning Git can be a bit daunting • December 2011: Git has three “philosophical” distinctions in its favour, as well as more attention to detail Lowest common denominator It is more important that people start using dis- tributed revision control instead of nothing at all. The Pro Git book is available online. Collaboration styles • Mercurial working practices • Collaborating with other people Use SSH shorthand 1 Installation $ sudo apt-get update $ sudo apt-get install mercurial mercurial-git meld Configuration Local system-wide configuration $ nano .bashrc export NAME="John Doe" export EMAIL="[email protected]" $ source .bashrc ~/.hgrc on a client user@client $ nano ~/.hgrc [ui] username = user@client editor = nano merge = meld ssh = ssh -C [extensions] convert = graphlog = mq = progress = strip = 2 ~/.hgrc on the server user@server $ nano ~/.hgrc [ui] username = user@server editor = nano merge = meld ssh = ssh -C [extensions] convert = graphlog = mq = progress = strip = [hooks] changegroup = hg update >&2 Initiating One starts with initiate a new repository.
    [Show full text]
  • Git/Hg Rosetta Stone
    Git/Hg Rosetta Stone hg git hg cat -r rev some_file git show rev:some_file hg clone http://hg.sympy.org/sympy-git.hg git clone git://git.sympy.org/sympy.git hg clone -U http://hg.sympy.org/sympy-git.hg git clone --bare git://git.sympy.org/sympy.git hg diff git diff HEAD hg status git status hg status -c git ls-files -t | grep '^H' hg manifest git ls-tree -r --name-only --full-tree HEAD hg parents git show --pretty=format:'%P' -s hg commit git commit -a hg record git add -p; git commit # or, for a more detailed interface: git add -i; git commit hg email -r tip git send-email HEAD^ # or: git format-patch HEAD^ ; git send-email 0001-Add-whitespace.patch hg view gitk, git gui hg help command git help command ~/.hgrc ~/.gitconfig .hg/hgrc .git/config hg paths git remote -v git remote add name url # see "git help remote" for more info how to edit paths; alternatively, you can edit them by hand in editing paths in .hg/hgrc .git/config too .hgignore .gitignore .hg/hgrc [ui] ignore .git/info/exclude hg add git add (note, it adds _content_ to index; can work on a hunk-by-hunk basis with -p!) hg rm git rm hg push git push hg pull git fetch hg pull -u git pull hg addremove git add -A (or: git add .; git ls-files --deleted xargs git rm) hg revert -a git reset --hard hg revert some_file git checkout some_file hg purge git clean -fd hg purge --all git clean -fdx git reset --hard 2fccd4c^ (on a normal repository) hg strip 2fccd4c git reset --soft 2fccd4c^ (on a bare repository) hg export git format-patch hg import --no-commit some.patch git apply some.patch hg import some.patch git am some.patch hg out git fetch && git log origin/master.
    [Show full text]
  • Collaboration Tools in Software Engineering Stepan Bolotnikov Me
    Collaboration Tools in Software Engineering Stepan Bolotnikov Me ● Stepan Bolotnikov ● Software Engineer at Guardtime ● MSc in Software Engineering from UT, 2018 ● [email protected] You Mostly BSc students in Computer Science ● Software developers / QA engineers ● CS researchers ● Project managers / team leads In any case connected to software projects, sharing knowledge and resources Course ● History and working principles of version control systems (VCS) ● Git distributed VCS ● Issue tracking ● Theoretical knowledge + practical hands-on exercises ● 8 sessions ● Every 2nd Friday ● Lecture + practice ● Non-differentiated (pass/fail) Schedule ● 22. Feb - Introduction, history of VCS ● 08. Mar - Introduction to Git, setting up the first repository, basic Git usage ● 22. Mar - Common Git commands ● 05. Apr - Branching in Git, common branching models ● 19. Apr - Troubleshooting common Git issues ● 03. May - Github; Issue tracking ● 17. May - Advanced Git usage; git hooks and CI ● 31. May - Guest lecture, preparation for exam ● 07. June - Exam 1 ● 14. June - Exam 2 Sessions ● 4h ● Lecture part ● Practical part Final exam ● 7th or 17th June ● Individual practical tasks ● “Poor”, “Satisfactory” or “Good” ● “Satisfactory” and “Good” - passing In order to pass the course ● Active participation in at least 6 out of 8 sessions ○ Complete the practical tasks ● “Satisfactory” or “Good” on the final exam Communication Course website http://courses.cs.ut.ee/2019/cse Course Slack Click Lecture 1: Introduction to course, History of Version
    [Show full text]