1. Read G
it ebook
2. Install
Git GUI clients. (I use
SourceTree)
3. Have fun with Git
Note: SourceTree makes you live easier and you don't have to remember git commands.
Create a Repo:
https://help.github.com/articles/create-a-repo/
Must use tool:
SourceTree
SourceTree tutorial
Do a Commit: push your code to github
1. From GitHub create new repo. It will give you a url: www.github.XYZ.MyNewRepo.git
2. Go to the directory you want to push to git; $cd mydirX
$git init
$git add README.md
$git commit -m "first commit"
$git remote add origin https://github.com/AndreSand/gamma-android-app.git
$git push -u origin master
Now go to your new repo and you will see your code in there.
How to Marge Code:
.5 create new folder SOU
1. Clone
team Repo: /SOU$git clone https://github.com/Org/MyApp.git
3. $git remote -v
4. change pull origin to myFork url $git remote set-url
--push origin https://github.com/xx/MyApp.git
5. open app in AndroidStudio.
6. make changes,
a.
$git add . (add your files to the git repo)
b.
$git commit -m "First commit"
c.
$git push origin
7. make "Pull" request from GitHub fork (website my fork)
8. merge (website)
Useful Commands:
Remove your uncommitted changes:
$git reset --hard to remove your uncommitted changes
$git pull
Show origin:
$git remote show origin
$git remote -v
Remove origin:
$git remote set-url origin git://new.url.here
OR
$git remote remove origin
$git remote rm origin
Change Fetch URL:
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
Remove commits:
$git reset --hard origin/master