Git Product home page Git Product logo

git's Introduction

git

Git

cat ~/.gitconfig

git config --global-list

git config --global user.name "savipavan" git config --global user.email "[email protected]"

git config --global --list

cat ~./gitconfig

#set additional properties git config --global core.editor <<notepad++>> <> <> #Another configuration option git config --global help.autocorrect 1 #Set Color to output in Command Line git config --global color.ui auto

#To check all above configurations git config --global --list cat ~/.gitconfig

#update user name information git config user.name "pavankumar"

git config --global --list

#remove updated user.name git config --unset user.name "pavankumar"

git config --list

vim .git/config

#Creating A Local repository mkdir gittest #turn in into local repository git init ls -la echo "Hello, Git" > README.txt

Check the status

git status #Add the file in to Staging Repository git add README.txt git status

#git commit Added Readme.txt #check the history git log

#update README with second line git status

#Add all modified files git add -u

#commit the update with inline git commit -m "updated README.txt"

git log

#Check the differences in both commits git log

git diff <> git diff dd6819..a15ec6

git diff HEAD1..HEAD git diff HEAD1.. touch file1.txt file2.txt git status git add -u #it will add only updated files"

#Add files git add file1.ext file2.ext git add -A

git commit -m "Added new files" git log git diff HEAD~1

2.4Staging changes as multiple commits

vim file1.txt "Adding some code here" :wq!

vim readme "updated new changes" :wq!

git status git add file1.txt

git status git commit -m "fixed bugs#123"

git add README.txt git commit -m "Fixed typo in Readme.txt"

2.5Deleting and renaming files

rm file2.txt

git add -u git status vim file3.txt git status git add file3.txt git status

#change the file name mv file1.txt new_file_name.txt

git status git add -A git status

git commit -m "Reorganize the feature" git status git log

2.6Undoing changes to the working copy vim README.txt Remove all existing lines

git checkout README.txt git status cat README.txt

vim README.txt <> all the contents :wq!

#remove the file rm new_file_name.txt

git status

#reset the settings git reset --hard

#git status

2.6Undoing changes to the working copy

git log git reset --soft HEAD~1 git log git status

git commit -m "reorganize" git status

git log git reset --hard HEAD~1

git status

git log

2.8Cleaning the working copy

touch temp1.txt temp2.txt git status

git clean git clean -n git clean -f git status

2.9Ignoring files with .gitignore --- mkdir logs touch logs/log.txt

vim .gitignore logs or /logs/*.txt /logs.*log /logs :wq!

git status git add .gitignore git commit -m "Added .gitignore" git status git log

  1. Working Remotely with Git

  • Cloning a remote repository
  • Listing remote repositories
  • Fetching changes from a remote
  • Merging changes
  • Pulling from a remote
  • Pushing changes remotely
  • Working with tags

3.1 Cloning repositories

git clone https://github.com/jquery/jquery.git

git's People

Contributors

savipavan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.