Monday, February 20, 2017

What are some Python concepts I must know?

Friday, August 26, 2016

Git Tutorials

1.Initialize git repository

git init-It will create a new empty directory /.git/.The directory is hidden by default

2.Current status of git

git status-all file changes in the repository

3.Add newly created file to repository

git add filename-added file in staging area.not a part of repository yet.To store the file in repository we need to commit changes

4.Store file repository

git commit -m "commit commands"

5.Add Multiple of same type
use wildcard
git add ".txt"-where .txt is file extension

6.Log of commit
git log

7.Remote Repository
Create an account in git to use git remotely,create a project

To use git in remote repository
use
git remote add origin https://github.com/try-git/try_git.git
name of our remote is origin .default local branch is master

7.save all data to remote using push commands
 git push -u origin master
-u will save parameter,so next time only use git push

8.get changes in repository by pull command
git pull origin master

9.Find difference between two commit using diff command

git diff HEAD-Where head refers to last commit

Staged file are files that are ready to commit

10.remove a staged file using git reset
git reset staged file name

11.Files can be changes to how they were in last commit using git checkout command

git checkout -- filename

-- refers that no arguments after --

14.create a branch

mostly all bug anf features are commited to branch and merge to master

git branch branch name

15.show branch name

git branch

16.To switch between branch use git checkout branch name
git checkout branch name

17.To remove files from git use rm

git rm