Skip to main content

Posts

Showing posts from 2017

Basic git commands to handle codes

Creating a Repository on GitHub: ------------------------------------------ 1. Sign in to GitHub 2. Click the "+" sign beside your profile and click "New Repository" 3. Provide repository name and other necessary things if needed. Pushing Code/project folder into GitHub Repository: ------------------------------------------------- 1. Go to the project location on your pc/laptop. 2. Enter into the Project. 3. Right click on mouse and select "Git Bash Here" 4. Run the following commands SEQUENTIALLY -            git init            git add -A ( add your files )            git status            git commit -m "Your Message" ( commit locally )            git remote add origin GITHUB HTTPS PROJECT LINK                                   ...

How to Backtrack- Learn different ways to undo changes made to a Git project and when to use them.

Head commit : In Git, the commit you are currently on is known as the  HEAD commit. In many cases, the most recently made commit is the HEAD  commit. To see the  HEAD  commit, enter: git show HEAD The output of this command will display everything the  git log command  displays for the  HEAD  commit, plus all the file changes that were committed. For example:  Enter the command to show the  HEAD   commit. Notice the output. The ghost's most recently added line is in green text. Git Checkout: What if you decide to change the ghost's line in the working directory, but then decide you wanted to discard that change? You  could  rewrite the line how it was originally, but what if you forgot the exact wording? The command git checkout HEAD filename will restore the file in your working directory to look exactly as it did when you last made a c...

Git Branching- Learn how to manage multiple versions of a project with Branching.

Git Branch: Up to this point, you've worked in a single Git branch called  master . Git allows us to create  branches  to experiment with versions of a project. Imagine you want to create version of a story with a happy ending. You can create a new branch and make the happy ending changes to that branch only. It will have no effect on the  master branch until you're ready to merge the happy ending to the master branch. In this lesson, we'll be using Git branching to develop multiple versions of a resumé. You can use the command below to answer the question: “which branch am I on?” Command : git branch Check what branch you are currently on.  In the output, the * (asterisk) is showing you what branch you’re on. The diagram above illustrates branching. 1. The circles are commits, and together form the Git project's commit history. 2. New Branch  is a different  version  of the Git project. It contains commits...