yuval.guide — Guides and hands-on courses on DevOps, cloud, Linux, Python, Kubernetes, networking and AI.
Create 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 MoreBASH Arrays See here. Indexed arrays 1names[0]=Yoesf 2names[1]=David 3echo $names # will show: Yosef 4echo ${names[1]} # will show: David Assigning complete arrays. This is done by surounding a list of word with parentheses: 1-> girlz=(Betty Liza Jane) 2-> echo ${girlz[2]} 3Jane 4-> echo ${girlz} 5Betty 6-> or even: …
Read MoreUse this tutorial as an intuitive introduction. The go here and read more details. Why Branches Our repository from the previous example has 3 commits and 3 files. Let's say that this is a software project, and our code (those 3 files) is good, and we know we now want to do 2 things, that may conflict later: We want to …
Read MoreAdding more commits In the previous post we have created our first commit. It was a new file that we added to our repository let's add more commits: Add file2 that is already in the working directory Add another file, this time inside a directory a change in a file already there Adding more file Adding file2: 1$> 2$> …
Read MoreMaking sure you remember that we are talking about a local git repository here. That's right, that .git invisible directory, right inside your project directory. Locations Consider this cli listing: 1$> 2$> pwd 3/home/osboxes/my-project 4$> ls -la 5total 12 6drwxrwxr-x 3 osboxes osboxes 4096 Jan 22 11:24 . 7drwxr-x--- …
Read More(this is a walk-through, so prepare your computer and let's play around with git) Saving Versions in git This is the main thing in a version control system, isn't it? Let's say you have a project, so several files Installing git Git is basically a cli program, and the installation should not be too hard. Go to the …
Read MoreA short History of Git As always, the git-scm book (see below) does a great work about that here. To summarize: This is really the history of the creation of the Linux kernel In the early days.....changes to the software were passed around as patches and archived files. (remember that zip file from my story?) In 2002, …
Read More