1. Creating repository on your computer:
git clone https://gitub.com/username/projectname
2. making your name known to git.
git config --global user.email "email@example.com"
git config --global user.name "your name"
shows you the log of the previous commits.
ps. press q to get out of it !
shows you the short list of the logs.
shows you what changes have been done and need to be Added.
git Add .
Add every changes you made or be specific by
git Add Readme
the file you want to add
git commit -m 'message'
commits the changes, it means you SAVE a state of the current folder to have it in mind to get back later. It's like a storage you push you commits to pull it when you want.
After commit you need to send your changes to proper location on the gitbub. The job is done by:
git push origin master:
this command sends the changes to the website and sync it. The origin master is the location we are in. If there are other projects we work on then it's possible to push other stuff.
git pull origin master:
does the opposite one, it actually gets the changes on the local by syncing to the hub.
does show you your last commit and shows what went done.
git show -h:
it shows you some helps.
In a big project we use simple graphical interface
get checkout Readme
get the last one.
git --hard reset xdfsdf (it is the ref)
we make the one we want from the before commits to the start
If we want go back ver back in time.
get the error
we need to force it
git push --force
changing from green state to red sate, it means we don't want to revert the ADD command.
git reset HEAD readme
to see everything
in a textfile
git rm --cached readme
to make it untrackable
--- merge conflicts
Part 4, 5:
mv directory ~/
moves the directory to a new place
by this command we are able to move the repository to a new place.
git --config color.vi true
to get colors
git status again
rm the orig
you can make a new branch to work on the new feature and then
we need a copy of the project]
git checkout -b newfeature
create a new branch
git branch -a
git push origin newfeature
git checkout master // for switching to the branches
If we want to merge
git branch shows you locals
merge of new features on the origin master
when you are in master you merge new in it
git merge newfeature
git branch -d newfeature
del from the local
git push origin :newfeature
del from the remote