Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Updates missing. How to fix?

refrost April 11, 2019

I have a project which I have been modifying and adding, committing, branching,  pushing under git bash version control commands from the project directory on a Windows 10  PC.    When I finally re-visited my  bitbucket.org account, I discovered  the last update was listed as 06/28/2015.

That corresponded with me making a branch which shows in my local history as

[dev54] -- [remotes/origin/dev54]     6/28/2015

which is what shows as the last update in my bitbucket projects dashboard list.

 

After that, I created a brach and then checked it out

---git add -u
---git commit -m '6/27/2015'
--- git push pswd: ..pswd..
========
---git branch dev54mysqli
---git checkout dev54mysqli
==== This does NOT show as updated on bitbucket.org

 

1.  Is there a reason why subsequent pushes after that date stopped updating in the bitbucket.org repository?   Is it related to checking out a branch?

 

2. What alternatives are there to  update the existing repo with the missing changes?

 

3. Would it be better (if I don't need the history), to just start a new repository with the current source code?  If so, how do I remove the local git directory and start a new one?

 

Thanks in advanced for any suggestions.

 

 

2 answers

2 accepted

1 vote
Answer accepted
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2019

Hi Ralph, welcome to the Community! 

Can you double check that you've been pushing your changes to the right repositories?

Can you also try pushing the changes now and show us the output in your terminal?

Alternatively, as you suggested, you could create a new repository in Bitbucket and then upload this repo as a new one. If you want to keep the history, you won't need to remove the git directory. To do so, please follow the instructions at Push versioned code to an empty repository. Otherwise, if you don't want to keep the history, you can remove the .git directory and follow the instructions at Get started with Bitbucket.

Hope that helps!

Ana

refrost April 13, 2019

Ana,
Thank you for your reply and advice. I am a solo developer doing maintenance on my local machine and have made what I thought are 'sequential' branches (shown below) when starting different phases, with additional commits and pushes in between when other changes were needed. The code in the current branch is in production but I am not clear on whether or how to merge these branches back to 'Master'. If you can advise, I'd appreciate that, or if it's better to just start a new repo...
My thought or hope was that the pushing would keep a copy of the code and versions on bitbucket.
I tried the push command (see below) and see I get an error. I don't think I was getting this error on prior pushes but can't be sure now.
## list of branches

git branch --list
dev54
dev54mysqli
dev55mysqli
dev55responsive
* dev55responsivehttps
master
## result of git push today with error rf@win10 /C/wamp/www/twin (dev55responsivehttps)
$ git push
fatal: unable to access : error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Does this have a simple fix?
Thanks again.

0 votes
Answer accepted
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2019

Hi Ralph,

According to https://community.atlassian.com/t5/Sourcetree-questions/sslv3-alert-handshake-failure/qaq-p/952664

You might want to check the version of git you are using: 'git --version'

The related article seems to indicate that error may occur if you are using version 1.x instead of 2.x.

If you are still on a 1.x version of Git you might want to try upgrading to version 2.x and try the push again.

refrost April 13, 2019

Thank you, James.  After upgrading from 1.9 to 2.21 and then  doing git push I didn't get the prior error and was prompted to login to Atlassian and bitbucket (which I may have failed at).   Got msg: "logon failed. use ctrl+c to cancel basic credential prompt. Everything up to date."

Yet, the last update in bitbucket is still listed as 6/28/2015 and for an old (first) branch different from the current local branch.

 

Editing a file, adding and re-doing git push just gives "Everything up to date' but no change/update in remote repo.

 

I think I will start a new repository and see if I can learn more  about git.

 

Thank you.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 14, 2019

Hi Ralph,

Just  to give you some pointers with Git just in case you aren't performing this sequence of steps.

1) You have edited a file.

2) You will need to "stage" those changes using the 'git add --all' command (I recommend using --all when you plan to commit all the modified files, otherwise stage them individually like: 'git add ./src/some/path/to/changes.txt'

3) You are going to create a new local commit using: 'git commit' (if you add -m "<commit message here>" you can define the commit message without being taken to the interactive editor.

4) Now that you have a local commit you are ahead of the remote repository by one commit, you should be able to run 'git push' and have your new local commit send to the remote repository.

I hope that helps.

-James

refrost April 14, 2019

Thank you, James.

 

I've been using those three commands, but apparently something failed a few years ago which stopped  updating the remote. I suspect or guess it might have been due to me branching and then switching to the new branch.  I say this  because the remote shows master and the first branch but not subsequent branches I created. 

Can I just git merge those branches back into themselves and then into master?   I also wonder about the config.push-url  and whether the dashboard must be set on https as is in the config.

 

I clearly need to read and understand more.

 

Thanks, again.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 14, 2019

Hi Ralph,

I'm not sure exactly how you are creating branches, but here's what I can offer.

If you are creating local branches before the remote, it won't be able to correctly link to the proper remote branch.  You can always fix this manually with: 'git branch -u origin/<branch_name>'

If you want the link to be created automatically, I'd recommend creating the branch in BitBucket first, then run 'git fetch' on your local machine, and watch the console output to see that the same branch name is picked up as a new branch before trying to run: 'git checkout -b <branch_name>'. 

If a remote branch already exists with the same name the link between them should automatically be created.

-James

Like refrost likes this
refrost April 14, 2019

Thank you, James.  I have created branches locally and sequentially, with no merging yet -- assuming those would 'copy' to the remote, but they apparently don't.

 This is what I have done locally:

git branch --list
dev54
dev54mysqli
dev55mysqli
dev55responsive
* dev55responsivehttps
master

 

And after creating each branch, I would checkout  to it and continue making edits and commits. I assumed I was creating a branch from a branch... from master.

 

If I did want to merge all these branches  back down to master would I , say,

git checkout -b dev55responsive    and then

git merge dev55responsivehttps

then,

git checkout-b  dev55mysqli

git merge dev55responsive

and so on?

 

And then after git push the master might update on remote?

 

Woud this be same or equal to: 'git branch -u origin/<branch_name>' ?

THANKS for any help you can offer.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2019

Hi Ralph,

To be clear the '-b' option on the cherckout command is just a shortcut to tell git to try and create a new branch with the name specified before switching to that branch.

One thing I hate about the checkout command is that context is very important.

If that branch doesn't exist then running that command will create a new branch that will start at the head commit of the branch you are currently on and switch to the new branch which might not be what you intended to do.

To get back to your question, if you want to merge all the changes back into master what I would recommend instead is the following:

- 'git checkout master'

- 'git merge <branch_to_merge_to_master>'

Then keep merging all the branches locally, this way you can resolve all the conflicts (if there are any) between the branches in your local copy of the master branch.  then when you are satisfied with it, 'gitpush' those changes to the master branch in BitBucket.

I hope that helps.

refrost April 15, 2019

Thank you, James, for the -b and other.   But I don't follow/understand going to master and then merging my branches, or ....

 

It seem to me that since I created the branches 'sequentially' [upgrading  code files to php5.4 then  to php5.5, etc.,] that I'd want to reverse or step 'back through' that same process.  But I also see I am not clear on what or how git is selecting the "right code" or that my conceptual model of branching is not appropriate.

OR... is it that as you suggest if I go to master and merge in the first branch's edits, then the 2nd branch's edits, then the 3rd branch's edits, etc., that at the end, the code in the master would be the same as in my most recent branch -- but if I ever did want/need to revert to some intermediate code, theoretically, I could?

Since such reverting back is very very unlikely to ever happen would I be 'better off' to delete the local  .git directory and then just start a new repository with the current code? (While trying to learn the right way to do branching...)

 

Thanks.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2019

Hi Ralph,

Yes, what you have outlined in the second option is precisely what I was trying to get to.

-James

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events