Index ¦ Archives ¦ Atom > Tag: Git

Fear of cherry-pick

I was very happy for doing a lot of essential changes and making it's one PR in reference with more than one issues. I asked one of my friend @bhavin192 to review these changes because I want to merge this PR as early as possible. I was expecting to get …


How to create pull request!

Creating first pull request is an exciting feeling I have ever met during my first pull request. I got to know about Hacktoberfest. They have given challenge of creating four pull request to win T-Shirt. Earlier, I have gone through sample pull request with my friend's project. I selected one …


How to push files on GitHub!

I have created files on my local machine. It includes assignments, projects, documents, sample programs in C, C++, Java etc. Now I don't have any single file with me as a proof of my work. Why does it happened? It all happened because of not storing my files anywhere. Also …


git clone

git clone

  • The clone command tells Git to fetch files from remote repository
  • “master” is the default name for a starting branch when you run git init
  • “origin” is the default name for a remote when you run git clone
  • If you run git clone -o newbrnach instead git clone …

git branch

git branch

  • Branch is pointer to changes commited by you

What to do?

  • To check on which branch you are woking now

    git brach

  • To create new branch

    git branch

  • Change the working to branch to what you want

    git checkout

  • Now just change one file

    git status

  • Add this …


git push

git push

  • The push command tells Git where to put your commits when you are ready with your files
  • “master” is the default name for a starting branch when you run git init
  • “origin” is the default name for a remote when you run git clone

What to do?

  • Enter …


git remote

git remote

  • Remote is a server like GitHub, Bitbucket etc
  • You need to add a remote repository url to access them
  • Let's take remote url https://github.com/ganeshhubale/python_programs. git which is used to push your local files to the GitHub repository:- python_programs
  • You can assign any name to …

git add

git add

  • It will add the files to staging area
  • To tell Git to start tracking changes made to file, we first need to add it to the STAGING AREA

git add -A .

The dot stands for the current directory, so everything in and beneath it is added. The -A …


git commit

git commit

  • Commit is snapshot of the exact state of every tracked file in your working tree
  • " git add " doesn't really affect the repository in any significant way
  • changes are not actually recorded until you run " git commit "
  • Basically git commit "records changes to the repository" and it is used …

git status

git status

  • It is healthy to run git status often
  • Sometimes things change and you don’t notice it
  • It gives the status of files like untracked, unmodified, staged and unstaged

staged:

Files are ready to be committed.

unstaged:

Files with changes that have not been prepared to be committed …

© Ganesh Hubale. Built using Pelican. Theme by Giulio Fidente on github.