Git and GitHub
Git and GitHub
(This creates a .git file which is provided by git which store the
project history)
5. git add filename – to add the changes made to the stage before
committing it for other to see we use git add
10.git log – to check all the commits made to the project we use
git log. It gives us the commit history.
12.To go back and see the code of any previous commit we use
git reset hashid for example. git reset
f0d43908da9c5fb24101f0bbea03166f4fcb68b3
13. git stash : This is used for changes that we want to make but
not move to commit at that time and save it somewhere.
14.To bring the changes done using git stash back to the surface
we use git pop
15.git stash clear to remove the changes stored in the stash
16.To link your project in your local to the git repository this is
the command
git remote add origin <git-url>
here remote means we are working with the url
add means we are adding a new url
origin means the name we are using for the url <git-url>, for
this we are using the name origin.
17. To move our code from local to the git repository we use
git push origin master
(here we are pushing the code to the master branch)
27.