Category: version controlling

All about Git – “Git Stash” Part – II

In this post, I am going to discuss on a very powerful command “git stash”. It is a very powerful command and that is why I want to dedicate a single blogpost discussing only about this important command.WHAT IS GIT STASH:This command will temporarily shelve the changes you’ve made to your working copy so that you can work o something else, and then come back and re-apply those changes at later point in time.HOW TO STASH YOUR WORK:The command git stash takes the uncommitted changes (both staged and unstaged) and saves them away for later use, thus reverting them from your working copy.For example, I have two files “test.txt” and “NewOne.txt”. Out of these two files, “test.txt” is staged and ready to be committed whereas the file “NewOne.txt” is yet to be staged.So if I issue the command git status, below is the result -Now if I issue the command git stash, let’s see what happens -So if I open the file, I will notice that all my changes to these two files are gone. But where? How can I get those changes back? So many questions!! 🙂 I will come into each of these questions slowly.One important point to tell here is that stash is local to your Git repository; stashes are not transferred to the server when you push.HOW TO RE-APPLY THE STASHED CHANGES:One can re-apply the stashed...

Read More

All about Git – Cheat Sheet – Basic Part – I

WHAT IS GIT?In today’s world, the most widely used modern version control system is Git. Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel.SETTING UP A REPOSITORY:Git uses the below command to create a new Git repository.git initExecuting this command will create a .git subdirectory in the project root and transforms the current folder into a git repository.The below command will create a new folder named directory and initialize the repository by creating .git subdirectorygit init BARE REPOSITORY:The below command will create the bare repository.git init –bare The –bare flag will create a repository which is having no active working directory. This is very important. You should always consider creating your central directory as a bare directory and from there create all your branches (non-bare directory) where the developers will work. Once the work is done, developers will merge their code from branches (non-bare directory) to central repository(bare directory). Since the central repository is bare directory and does not have any active working directory, there is no chance of editing the files and committing them.CLONING AN EXISTING REPOSITORY:The git clone command copies an existing Git Repository. Cloning always creates a remote connection called origin pointing back to the original repository. This makes it very easy to work with the central repository.The below command will...

Read More

Version Controlling in Salesforce with Git + Eclipse

I always prefer version control while doing coding. I can’t think of writing code without version controlling. But when I moved to Salesforce, the first thing that I was looking for is the version controlling to have better source code control.I worked with many version controlling tools like CVS, SVN etc. But I personally feel Git is the best version controlling option we are having now. I am a big fan of Git. Git is much more powerful than any other version controlling tool. Here in this post, I am not going to describe the advantages of Git. But if you want, you can refer below URLs to understand how powerful Git can be: in this post, I will explain how we can use Git + Eclipse for Version Controlling in Salesforce.Step 1: Once we download and install IDE, we need to install the Git plugin. The name of the plugin is: EGIT. We can download the same from 2: Get the salesforce code into your local worspace.Step 3: In this step, we will configure the “Local Repository”. What we need to do is: Right Click on Project | Team | Share Project.Step 4: We need to choose Git as an option and click on “Next”Step 5: Here we need to click on “Create”. Select “Parent Directory” and “Name” as below and click on “Finish”. This is the step where we will mention the local repository name and the path.Step...

Read More

Earlier Posts

  • 2024 (22)
  • 2023 (47)
  • 2022 (25)
  • 2021 (35)
  • 2020 (41)
  • 2019 (13)
  • 2018 (16)
  • 2017 (14)
  • 2016 (18)
  • 2015 (74)
  • 2014 (20)