Github Cheatsheet for Beginners 2

For Github Cheatsheet for Beginners 1 .

To pull along with changes .

git pull https://git link here

git remote rename origin newname [ from origin to newname ]

git remote -v [press enter]

git tag [ to create a tag for previous commit ]

git tag -a v0.1 -m ‘Version 0.1’

git tag [ to see ]

git show v0.1

To create a tag for prev commit [ie i have committed but no tagged then ]

[first show log to do that]

git log –pretty = oneline

[Copy the first 5 or 6 digit hash code of the commit you want to tag ] .

git tag -a v0.2 <past hash> -m ‘Version 0.2’ [press enter]

git push newname –tags

Github Cheatsheet for Beginners 1

Github is a Subversion control system See Wiki or Youtube . I’ll be brief and less descriptive cause it’s the basic commands . If i make a mistake or need to add some thing comment down below .

git config–global user.name “JohnDoe”

git config –global user.email “johnDoe@gmail.com”

git init

git add *.java

git commit -m ‘ write a comment to tell what you changed’

git status

git diff

git diff –cached

git commit -a -m ‘write a thing’ [ “a” is  to skip the staging ie adding the files , it will add everything ]

git rm -f Delete.txt

git rm –cached DeleteMe.txt [to remove from staging area but it is going to be in the drive to check do git status]

git mv filename.txt fielnameChanged.txt [to rename then do git status to check ]

To see commit msg in reverse chronological order we use log .

git log –pretty=oneline [to see in one line]

git log –pretty = format: “%h:%an:%ar:%s” [press enter] [Format to see exactly how you see on the screen]

git log -p -2 [to see last to commit]

git log –since=1 week [last week commit ]

git log –since = “24-01-2014″

git log –author=”Rittamd” [press enter to c changes made by specific author]

git log –before = “24-01-2014”

To undo a commit . 

git commit –amend

To decide to stage a file later you decide not to stage it ie :

git add Delete.txt [staged]

git reset HEAD Delete.txt [Not staged]

git status [press enter to c that Delete.txt is not ready to be committed]

git remote add origin https://github&#8230;../ABC.git

git push origin master

git remote -v

To get the data from remote (or the changed data) but not merge it to the local disk .

git fetch origin

for more visit here

To continue