You already know how to clone, branch and merge. This lab adds one more tool: git worktree , which lets a single repository have several working directories checked out at the same time. Why it matters: one working directory can hold only one branch at a time. That is fine for one person doing one task. It breaks the …
Read MoreThis configuration starts by creating a pair of keys and handling them on linux. This is good also for tasks like connecting to a remote machine in the cloud. At the end, we also go through using this for github (so adding the public key to a github account). Add SSH key To work with github or connecting to a remote …
Read MoreThe first (and easier) option is: create a repository in github clone it to your local computer In this way, all your remote definitions will be configured automatically. Create a new repository in github login to github. This is changing from time to time, and my involve configuring a phone as a secondary …
Read MoreCreating a new key-pair I am using a Windows-11 Professional os. OpenSSH client is included by default in Windows 11. This is how I'll create a kwypair: Try to see if the .ssh directory exists, and there are any previous keys there: 1dir ~/.ssh If the directory is not there, it will be created when you create your …
Read MoreHere's an example of the git cherry-pick command. main branch create a new git repository called cherry 1$> mkdir cherry 2$> cd cherry/ 3$> git init 4hint: Using 'master' as the name for the initial branch. This default branch name 5.... 6... 7Initialized empty Git repository in /home/osboxes/cherry/.git/ add a file …
Read MoreCreate a demo repository Create a new demo repository in github and clone twice: 1cd ../../a/demo/ 2git clone <your demo repository url> 3cd ../../b/demo/ 4git clone <your demo repository url> Create basic feature1 branch (same in both places) Create a feature1 branch in a and add something in it, then push. 1git …
Read MoreCreate Repositories Go to your github account anc create a public repository. (I have created one called demo) This is just a training session, so you will remove this repository when you're done. Locally, create a working directory (called demowork), and 2 directories under that: 1mkdir demowork 2cd demowork/ 3mkdir a …
Read MoreMerge Conflicts Preparations Use your previous knowledge to preoare the following: A repository called demo A branch called feature1 with: a file called file.txt The file has 3 lines with the following content (copy and paste exactly these characters): 11111111111 22222222222 33333333333 Make sure this is commited. Add …
Read MoreThis is a walkthroug. You are going to create a local repository, and do everything needed to push your work to a remote github repository. Create a local repository Create your local repository by typing: 1git init Config git user name and email (these are not github user and email): 1git config --local user.name …
Read MoreWhat is git merge Let's say you work in your local git repository, and you were doing some work in the work branch: 1$> 2$> git branch 3* work 4$> ls 5work1.txt 6$> You want to add something, but you are not sure it is going to be good, so you switch to a new branch (called new-work). The -b option instructs git to …
Read More