-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-tips.txt
More file actions
52 lines (44 loc) · 1.97 KB
/
git-tips.txt
File metadata and controls
52 lines (44 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Creating a repo
===============
git init
git remote add origin ssh://git@bitbucket.org/lborda/devops.git
echo "# This is my README" > README.md
git add README.md
git commit -m "First commit. Adding a README." .
git push -u origin master
echo "# This is my README" > README.rst
git add *
git commit -m "Second commit. Adding a README." .
git push -u origin master
git ubuntu kernel
==========
git describe --contains 334795e
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
git log --pretty=oneline > txt.txt
grep word txt.txt
==
Part 1: fork someone's repo: https://help.github.com/articles/fork-a-repo
click the 'fork' button on the repo you want to contribute to, in this case: Dwolla's PHP repo (Dwolla/dwolla-php)
get the URL for your newly created fork, in this case: https://github.com/tim-peterson/dwolla-php.git (tim-peterson/dwolla-php)
type the git clone->cd dwolla-php->git remote->git fetch sequence above to clone your fork somewhere in your computer (i.e., "copy/paste" it to, in this case: third_party TimPeterson$) and sync it with the master repo (Dwolla/dwolla-php)
makes changes to your local repo
type the git add->git commit->git push sequence above to push your changes to the remote repo, i.e., your fork on Github (tim-peterson/dwolla-php)
Part 2: make pull-request: https://help.github.com/articles/using-pull-requests
go to your fork's webpage on Github (https://github.com/tim-peterson/dwolla-php)
click 'pull-request' button
give pull-request a name, fill in details of what changes you made, click submit button.
you're done!!
==
How to send source code to bitbucket
First push. Install git tools
cd /path/to/your/project-source-code
git init
git remote add origin git@bitbucket.org:<owner-name>/<repo-name>.git
git add -A
git commit -m 'commit 1'
git push -u origin master
Updating source code and sending to bitbucket
git add -A
git commit -m 'commit #2'
git push -u origin master
git log --oneline