Index ¦ Archives ¦ Atom > Category: Tech ¦ Atom

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 …


git init

git init

  • init stands for initialization
  • Directory is a folder used for storing multiple files. It may be text or doc
  • Repository is a directory where Git has been initialised to start version controlling your files

What to do?

  • Create one directory/folder

    mkdir Documents/MyFolder

  • Go into that folder …


Basic commands in git!

Git is distributed version control system. It is useful to work with open source platforms like GitHub, GitBook etc. There are different commands to use it properly. Let’s enlist basic commands:

git init

git remote add origin < remote_repository_url >

git remote -v

git add < file_name >

git status

git pull origin …


How to install git on Fedora!

Installation of git requires following steps:

  • To check whether git has already installed on your system or not.

git --version

  • To install all the packages of git.

sudo dnf install git

  • Start to configure git with your information.

git config --global user.email < your_email > git config --global user.name < your_name …

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