DevOps Classroom Series – 08/Feb/2021

Multiple Users Workflow

Scenario:

  • Your Organization has a remote repository configured on GitHub
  • Two developers are working on features and they push the changes to git Hub
  • Now developers are working for release 1.0
    • Lets create a branch called as rel_1.0 and push the branch to github
  • Now developer 1 is working on linux machine machine
    • He is working on to create basic folder structure and he commits the changes
    • Now configure username and email and commit the changes to local repo
    • Now lets push the changes to remote repository
  • Developer 2 who is working on windows machine needs to get the changes submitted to start working
  • Now Developer 1 will be working on feature 1 and Developer 2 will be working on feature 2
    • To do this, lets assume organization is following feature branch approach
    • Feature branch approach is where developers create a branch locally for every feature and once the finish developing the changes, they will merge the changes to the rel_1.0 branch and push the changes
  • Now developer1 has merged the changes of feature1 to rel_1.0 branch and pushed the changes to the repository
  • Now developer 2 wants to merge the change of feature 2 to rel_1.0 branch.
  • To ignore some files or folders we create a file called .gitignore in the root folder and specify which folders or files need to be excluded from git
  • Refer Here
  • To generate git ignore file for the tools which you use Refer Here

Git configuration

  • This is config command to set some configuration values
  • In Git we have different config levels and files
    • –local: This is present in the .git/config
    • –global: This applies to a particular os user ~/.gitconfig
    • –system: This a system level configuration applied to all the users on the machine $(installpath)/etc/gitconfig
  • Refer Here for configuration values from official docs and Refer Here for attlasian documentation
  • Git Alias

Git Tags

  • Tag refers to the specific commit in git history
  • Git supports two kinds of tags
    • Lightweight tags
    • Annotated Tags
  • Annotated tags differ in amount of metadata they store
  • Refer Here for the official docs and Refer Here for attlasian tutorial

Changing the previous commits

  • Lets assume you have 3 commits f1,f2,f3
  • Now if you want to delete the f2 commit
git rebase -i HEAD~3
# fix merge conflicts if any and continue rebase

  • Now lets try to combine f1 and f3 as one commit
git rebase -i HEAD~2

Cloning a Particular Branch on Git repo

  • Clone only gh-pages branch from spring petclinic Refer Here

Git bare repositories

  • Generally when we clone repositories we get the working tree and .git folder.
  • But on git remote repositories (i.e. git on servers) we might not need working tree as no one will be working there, there we can clone bare repositories
  • In bare repositories you get only .git folder

Next Steps

  • We will learn the git communication protocols
  • GitHub/BitBucket/Git Pull request
  • Git branching strategy
  • We will learn how to build the code and start using jenkins and then visit the leftover git topics

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%