Difference between revisions of "VScaler: Using Bitbucket Repository"
Jump to navigation
Jump to search
| Line 12: | Line 12: | ||
Resolving deltas: 100% (25/25), done. | Resolving deltas: 100% (25/25), done. | ||
Checking connectivity... done. | Checking connectivity... done. | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == Pull down latest info from a branch or master == | ||
| + | * Use the '''<code>git pull</code>''' command | ||
| + | <syntaxhighlight> | ||
| + | Jons-MacBook:vscaler-openhpc Jon$ git pull | ||
| + | Already up-to-date. | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == Identify available and currently selected branch == | ||
| + | * Use the '''<code>git branch</code>''' command | ||
| + | <syntaxhighlight> | ||
| + | Jons-MacBook:vscaler-openhpc Jon$ git branch | ||
| + | * jon-test | ||
| + | master | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 25: | Line 40: | ||
Branch jon-test set up to track remote branch jon-test from origin. | Branch jon-test set up to track remote branch jon-test from origin. | ||
Switched to a new branch 'jon-test' | Switched to a new branch 'jon-test' | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == Identify changes == | ||
| + | * Use the '''<code>git status</code>''' command | ||
| + | <syntaxhighlight> | ||
| + | Jons-MacBook:python Jon$ git status | ||
| + | On branch jon-test | ||
| + | Your branch is up-to-date with 'origin/jon-test'. | ||
| + | Untracked files: | ||
| + | (use "git add <file>..." to include in what will be committed) | ||
| + | |||
| + | hello.txt | ||
| + | |||
| + | nothing added to commit but untracked files present (use "git add" to track) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == Add a modified file to your local index == | ||
| + | * Use the '''<code>git add <filename></code>''' command | ||
| + | <syntaxhighlight> | ||
| + | Jons-MacBook:python Jon$ git add hello.txt | ||
| + | </syntaxhighlight> | ||
| + | * And confirm with '''<code>git status</code>''' | ||
| + | <syntaxhighlight> | ||
| + | Jons-MacBook:python Jon$ git status | ||
| + | On branch jon-test | ||
| + | Your branch is up-to-date with 'origin/jon-test'. | ||
| + | Changes to be committed: | ||
| + | (use "git reset HEAD <file>..." to unstage) | ||
| + | |||
| + | new file: hello.txt | ||
| + | |||
| + | Jons-MacBook:python Jon$ git commit -am "Added a test file" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 13:51, 14 October 2016
Cloning main repo
- Use the
git clonecommand
Jons-MacBook:vScaler-scripts Jon$ pwd
/Users/Jon/Work/vScaler-scripts
Jons-MacBook:vScaler-scripts Jon$ git clone git@bitbucket.org:bostonhpc/vscaler-openhpc.git
Cloning into 'vscaler-openhpc'...
remote: Counting objects: 130, done.
remote: Compressing objects: 100% (100/100), done.
remote: Total 130 (delta 25), reused 0 (delta 0)
Receiving objects: 100% (130/130), 22.87 KiB | 0 bytes/s, done.
Resolving deltas: 100% (25/25), done.
Checking connectivity... done.Pull down latest info from a branch or master
- Use the
git pullcommand
Jons-MacBook:vscaler-openhpc Jon$ git pull
Already up-to-date.Identify available and currently selected branch
- Use the
git branchcommand
Jons-MacBook:vscaler-openhpc Jon$ git branch
* jon-test
masterSwitch to fork
- Switch to the top level directory for the local copy of your repo
- Use the following commands:
git fetchto download objects and refs from another repository.git checkout <branch_name>to switch to another branch (and specify the branch name)
Jons-MacBook:vScaler-scripts Jon$ cd vscaler-openhpc/
Jons-MacBook:vscaler-openhpc Jon$ git fetch && git checkout jon-test
Branch jon-test set up to track remote branch jon-test from origin.
Switched to a new branch 'jon-test'Identify changes
- Use the
git statuscommand
Jons-MacBook:python Jon$ git status
On branch jon-test
Your branch is up-to-date with 'origin/jon-test'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
hello.txt
nothing added to commit but untracked files present (use "git add" to track)Add a modified file to your local index
- Use the
git add <filename>command
Jons-MacBook:python Jon$ git add hello.txt- And confirm with
git status
Jons-MacBook:python Jon$ git status
On branch jon-test
Your branch is up-to-date with 'origin/jon-test'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: hello.txt
Jons-MacBook:python Jon$ git commit -am "Added a test file"