Git
What is Git
• Git is version-control system for tracking changes in computer les
and coordinating work on those les among multiple people.
• It is primary used for source-code management in software
development, but it can be used to keep track of changes in any set of
les.
wikipedia
fi
fi
fi
Git add to existing project
Install Git
https://git-scm.com
After installation you can check by typing git keyword in your terminal
Git initializing
• Go to project folder
• Open terminal
• Type ‘git init’
Add Git ignore
Git ignore is for ignore le or folder
Add .gitignore le to project folder
fi
fi
Git commands
.git init Initializing git folder to project folder
.git status Check git status for project folder
.git add * Adding le to git staging area
This command sets the author name and
.git con g email address respectively to be used with your
commits
.git clone This command is used to obtain a repository
from existing URL
.git commit This command records or snapshots the le
permanently in the version history.
$ git commit -m “ first commit”
.git remote This command is used to connect your local
repository to the remote server.
$ git remote add origin https://github.com/yethuaung882/test.git
fi
fi
fi
Git commands
.git push This command send the committed changes of
master branch to your remote repository.
$ git push origin master
This command fetches and merges changes on
.git pull
the remote server to your working directory.
Basic git commands with example