You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

See https://confluence.atlassian.com/display/BITBUCKET/Bitbucket+101

Getting Started

#--------------------------------------------------
#### create a directory
mkdir git-repo
cd git repo
 
#### download a copy of the initial upload
git clone https://USERNAME@bitbucket.org/SLAC-IEPM/imc14-tulip.git
cd imc14-tulip/
 
#### setup account
git config --global user.name "Your Name"
git config --global user.email you@example.com
#### Simplify accessing the URL by adding an alias 

git remote remove origin

git remote add origin https://YOURUSERNAME@bitbucket.org/SLAC-IEPM/imc14-tulip.git

#Now you'll just use "origin" when you want to use the URL

 
#### make changes
# vim ....
 
#### to see the status of the files (modified vs. unmodified)
git status
 
#### to commit files the -a option allows us to skip the explicit staging of the files
git commit -a -m "I revised section XYZ."
 
#### to upload the files the server
git push origin master
 
#### to view commit history
git log
 
#miscellaneous info
#--------------------------------------------------
#do not add or delete files with simple mv or rm, instead use git
git mv abstract.tex to anotherfilename.tex
 
#to add new/untracked files
git add <filename>
 
#then you'll upload them in the same manner
git commit -m "added file <filename>"
git push -u origin master

Using Browser to look at repository

https://bitbucket.org/SLAC-IEPM/imc14-tulip

Example

[cottrell@iepm ~]$ mkdir git-repo

[cottrell@iepm ~]$ cd git-repo

[cottrell@iepm ~/git-repo]$ git clone https://rlacotrell@bitbucket.org/SLAC-IEPM/imc14-tulip.git

Cloning into 'imc14-tulip'...

Password for 'https://rlacotrell@bitbucket.org': 

remote: Counting objects: 66, done.

remote: Compressing objects: 100% (64/64), done.

remote: Total 66 (delta 14), reused 0 (delta 0)

Unpacking objects: 100% (66/66), done.

[cottrell@iepm ~/git-repo]$ cd imc14-tulip/

[cottrell@iepm imc14-tulip]$ ls

IEEEtran.bst*  IEEEtran.cls*  IEEEtranS.bst*  Makefile*  bib/  figures/  latexdiff-svn.sh*  paper.tex* text/

[cottrell@iepm imc14-tulip]$ ls text

01-abstract.docx      02-introduction.tex   04-tulip.docx  06-results.tex      10-conclusion.tex

01-abstract.tex       03-related_work.docx  04-tulip.tex   07-discussion.tex

02-introduction.docx  03-related_work.tex   05-vtrace.tex  09-future_work.tex

[cottrell@iepm imc14-tulip]$ git config --global user.name "Cottrell"

[cottrell@iepm imc14-tulip]$ git config --global user.email cottrell@slac.stanford.edu

[cottrell@iepm imc14-tulip]$ git remote remove origin

[cottrell@iepm imc14-tulip]$ git remote add origin https://rlacotrell@bitbucket.org/SLAC-IEPM/imc14-tulip.git

[cottrell@iepm imc14-tulip]$ vim text/02-introduction.tex

[cottrell@iepm imc14-tulip]$ git status

# On branch master

# Changes not staged for commit:

#   (use "git add <file>..." to update what will be committed)

#   (use "git checkout -- <file>..." to discard changes in working directory)

#

# modified:   text/02-introduction.tex

#

no changes added to commit (use "git add" and/or "git commit -a")

[cottrell@iepm imc14-tulip]$ git commit -a -m "I revised the Introduction to add extra features we have added (accuracy), fix some grammar etc."

[master 2a144a6] I revised the Introduction to add extra features we have added (accuracy), fix some grammar etc.

 1 file changed, 5 insertions(+), 5 deletions(-)

[cottrell@iepm imc14-tulip]$ git push origin master

Password for 'https://rlacotrell@bitbucket.org': 

Counting objects: 7, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (4/4), done.

Writing objects: 100% (4/4), 873 bytes, done.

Total 4 (delta 3), reused 0 (delta 0)

To https://rlacotrell@bitbucket.org/SLAC-IEPM/imc14-tulip.git

   203cf3a..2a144a6  master -> master

[cottrell@iepm imc14-tulip]$ 

 

 

  • No labels